Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Force user to save file in particular directory
TroyB
When a user generates content after filling out a form, I would like to force them to save the file in a particular directory. I found in templating.cfg that I could define a directory dir-regex. I set it to "CompanyNews/OurCompany". This forces them to at least be in that directory or one of its subdirectories. I want to keep them from going into any subdirectories as well. I tried "CompanyNews/OurCompany$" and ".*/CompanyNews/OurCompany$" to no avail.
Furthermore, while it does give some error about me trying to save it in the worng location it displays the regular expression that I placed in templating.cfg which to our users would be meaningless.
As an aside, what do I need to write to post code in my forum message so it will not get formatted?
Find more posts tagged with
Comments
nipper
Read
this
page about formatting
I handle things differently, people preview DCR changes, workflow takes care of generating the file with the correct name and location.
I do not think you can do what you want with a templating.cfg change
Finally, update your profile or add a signature to your posts, give some information about products you use, versions, and OS. Or you can add it to each post but that is a pain.
Andy
TroyB
Thanks for the link.
We are not using workflows for people to preview changes, etc. Users directly fill out forms, save their data, and generate the output. That is the way it has been here since before I arrived and unlikely to change.
Ok...guess I will at least limit them to a particular "base" folder.
Thanks of the tip on updating my sig...done.
nipper
You do not need WF to preview. If you are using WF to push content out, which you quite likely are, then you can use it to generate the external pages.
TroyB
While we might be using WF to push out the content (I do not know for sure), it is being handled by scripts that I do not have access to and unlikely to be given access. So mucking with that is not available to me.
Also, I found something interesting. Using directory dir-regex, I can make sure that the user saves the record in a directory I desire with a specific file name that I desire. I can do this by expanding my dir-regex to include the file name so when I put the value as "CompanyNews/OurCompany/StockPrice.html" then they can only generate the file in that location with that file name.
So the attribute name of dir-regex is a little misleading since it appears to simply confirm that the final directory and file name return true for the regular expression you enter. That would explain why putting $ at the end was failing for me.
I know...I have the other thread and I still plan on looking at your advice about using FormAPI but I thought this was good if I can't get the FormAPI to work.