Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Prevent spaces in imported files
System
I am looking for a way to prevent users from importing files with spaces into Teamsite.
Find more posts tagged with
Comments
Migrateduser
Create file naming standards and enforce them amongst your user community. Spaces in filenames are bad, bad, bad. If you can't enforce standards then you have to get creative with your quotes in every script that handles filenames. It's a pain.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Migrateduser
I have let them know over and over again about the spaces, but they keep importing them. Today I implemented some FormAPI code to prevent them from saving a DCR with a space and other funky characters. But I am unable to programaticaly prevent them from using spaces. I was hoping to find some sort of solution.
Migrateduser
What kind of solution are you hoping to implement? Do you want to repell the files named with spaces and just not allow them to be saved, or will you be attempting to rename the files? What's the ideal solution?
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Migrateduser
Prevent them from being imported at all.
Migrateduser
Have you considered implementing the
iwatcreate
trigger to kick off whenever a new file is created? At least then you could handle the issue at file creation time and pretty much do whatever you want at that point.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Migrateduser
I agree with Dave. User training is the best solution. If you simple don't trust your users here are other options:
1. Use the "iwatcreate" command trigger. This will execute every time a file or directory gets created. You can have it do an automatic rename (i.e. change " " to "_").
2. Customizing your user interaction with TeamSite (which can be done using ContentServices). This can be messy.
3. Have uses create files through TeamSite Templating and have TeamSite generate file names. This assumes that the pages they import can be templatized.
Good Luck,
Bobby
V1.DRS
V2.DRS
Migrateduser
Nope, haven't looked into that. I'll have to give that a try, thanks for the suggestion, I'll update this post with my results.
Migrateduser
Just in case you didn't already know, the triggers are all documented in the Command Line Tools document. I'm not sure the trigger script could do anything other than rename or delete the file and send a notification.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Migrateduser
I did a little reading about the triggers, but there really isn't much there. I have Windows 2000 Server, does it have to be a service or can I just run a command from a command prompt to start a trigger. If so can you give me an example of a command and a simple ipl file to run. Nothing fancy, maybe something that writes out to a hello.txt file. This would really help me get started.