Uploading a document or image to its own URL via a browser
Archive - Originally posted on "The Horse's Mouth" - 2010-04-18 10:26:45 - Graham Ellis
One of the major requirements of a committee / working group such as the TransWilts Community Rail Partnership is to be able to share information - and a forum (such as Simple Machines) does that admirably. So after yesterday's meeting, I put up a forum for our initial work.
But one of the side issues / extra elements is to be able to upload and share pictures, documents and much more ... and that's where something a bit more is needed.
"How do you upload a picture to the site", "How do I share a document" is often asked; you could use sites such as flickr, but perhaps it's better to upload to your own site and keep everything in one place.
I've previously tested an upload page - [source] showing the upload mechanism, but now I've added a thin veneer on top of it to allow the uploaded files to be given their own URL, listed, replaced, etc. - and that new complete example with the veneer is [source here].
Security is a major issue with scripts such as this - avoiding data being injected by third parties who aren't part of the group and who have other purposes; we are using the security of the SMF login accounts we already have on the server - so that uploads will only work for logged in members and not for guests.