Reputation: 13
I am in the process of rewriting our websites and I have taken advantage of Coldfusion mappings to move my cfc files outside the root directory. I would like to do the same for documents (especially ones download to us) but it appears mapping won't work for that? Is there another way?
Upvotes: 0
Views: 331
Reputation: 5247
I assume you want to make your uploads available for viewing, in which case they need to be accessible by the webserver. I typically upload to a temp directory for processing, and then move the file to a permanent location, which is outside of my public webroot (www folder?), but mapped in the webserver so that the files can be served. I do this to keep source code completely separate from user generated content.
So a simplified directory structure might look like this:
/www
/cfc
/data
/data/temp
/data/user
As you've already figured out, your cfcs can be accessed via a mapping. Then, depending on your web server, you would make the data directory available, and lock down the kinds of files you want to serve via your web server.
Upvotes: 1