Reputation: 301
Relatively new to Sitecore. I've searched this one out pretty thoroughly here and on dev.sitecore.net, and haven't seen where these subjects overlap...
We've got a web forms for marketers form in production. We use content delivery servers, so the file uploaded via this form saves the image file that is uploaded to "web", and that's the only location.
The problem comes that if we publish that folder from master (or any parent folder) because uploaded items aren't in master, the all get wiped out, and we need to maintain these moving forward. Publishing restrictions, making the folder unpublishable, from what I understand (and have seen testing) means the same thing... a full site publish (which we want to be able to do) will wipe out these files because either the files aren't in the folder, and are lost, or the folder isn't published, which also deletes them.
What's the best way to handle data like this moving forward? I'd love a simple solution like being able to simply prevent the publish from touching that folder, but not removing it from web... otherwise, is there a way to adjust that file upload to go outside of the media library? As of right now, if I select the file upload field in the form designer, I can only select where within the media library folder I can save it... it would be nice if we could select a location maybe in another database? Is there a sitecore way to do this, short of hijacking the entire process and rewriting it through the c# backend? And if that's the best approach, where's a good spot to start digging into where that process can be captured?
Upvotes: 2
Views: 208
Reputation: 16990
The issue is not user generated content, but the configuration of the WFFM module. When installing WFFM on the CD servers you need to configure the remoteWfmService
connection string to point to the WFFM Remote Service on the CM server. This ensures that any actions are run on the CM server, and therefore any files which are uploaded or content which is generated is done so in the master
database.
Any publish of content (user generated or otherwise) will then get published out to the CD server/web database as normal then. This also has the advantage that should you wish to delete something (e.g. a user comment) you can do so from the CM server and publish again.
To configure the remote service at the following connection string:
<add name="remoteWfmService" connectionString="url=http://[masterserver]/sitecore%20modules/shell/Web%20Forms%20for%20Marketers/Staging/WfmService.asmx;user=[domain\username];password=[password];timeout=60000" />
If you have the wfm
connection string defined then you can remove this.
You also need to make sure that your Save Actions
do not have the Client Action
checkbox ticked, otherwise the action will run on the CD server, not the CM server.
You can find more details in the Multi-server Environment section (page 37) of the Webforms for Marketers Reference.
Upvotes: 2
Reputation: 27132
There is no one good answer to your question. What in fact your question is about is how to store User generated content
.
There are plenty of articles and discussions about it available online already.
Check e.g. https://www.google.com/search?q=user+generated+content+sitecore
You may see from the articles that there are many approaches you can use to achieve what you want. You just need to select one which will match your expectations and requirements in the best way.
Upvotes: 0