This topic here made me realise something: viewtopic.php?t=64458
Where do you save user generated content to? In the topic the poster is saving images to images/news. That's something I would never do. The images directory on a site I write is specifically for static images that I've created as part of the site design. I gather all the user content together in a single place away from the things I control, usually in a /content/ directory or subdomain, and organised by type or section, eg /content/pdf/ or /content/news/. The reason I do this is simple: it means I can take a copy of the website content and neatly slot it into a new version, or save it as a back up, or such incredibly quickly without having to work out what's user content and what's my content.
But is that the best approach? What other solutions have people come up with?
Saving uploaded content
Moderator: General Moderators
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
Save it to a specialised directory - mainly for your reasons too - but also so I can serve it from a separate subdomain (browser can parallel request) and also usually to keep it beneath the webroot where it can't be remotely called directly without going through a request gateway in the application code.
Mostly all I've dealt with regarding uploads is images.
In which case I have two directories
/uploads/
/thumbs/
I give each user their own directory (which is their user id in the users table)
/uploads/1/somefile.jpg
/thumbs/1/somefile.jpg
In which case I have two directories
/uploads/
/thumbs/
I give each user their own directory (which is their user id in the users table)
/uploads/1/somefile.jpg
/thumbs/1/somefile.jpg
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.