FreewayTalk

2 replies to this thread. Most Recent

Simon

17 Mar 2014, 9:05 am

[Pro] Upload pictures action on my site

Hi, I would like to add a facility to a webite that allows people to upload pictures for me to use - is this possible? Thank you Simon

waltd

17 Mar 2014, 1:46 pm

Not using Freeway and Actions alone. Freeway 6 can make a file input, and you can add the following name/value pair to the Extended interface in the Page / Form Setup dialog:

  • Name: enctype
  • Value: multipart/form-data

That, by itself, will allow someone to attach a file to your form and send it to your server. But once it arrives, it’s going to end up in /dev/null with everything else that the server doesn’t want, because there’s no application waiting to “catch” it.

FormsToGo (third-party application, not free) can create a form handler that can catch a file, but you really need to consider your reasons for doing this carefully. File upload scripts are probably the number one way that servers get hacked. Unless your script is carefully written to “whitelist” the files it receives (only allow certain types in, and really read the files, don’t just take their file-extension as Gospel), you are setting yourself up for disaster. And if you’re on a shared hosting server* then you will have up to a thousand other people staring at you with murder in their eyes.

Walter

*Do you pay ~$9/month? You’re sharing that server.

On Mar 17, 2014, at 5:05 AM, Simon wrote:

Hi, I would like to add a facility to a webite that allows people to upload pictures for me to use - is this possible? Thank you Simon

Freeway user since 1997

http://www.walterdavisstudio.com

Back to Top

Simon

19 Mar 2014, 8:31 am

Thank you Walter. It doesn’t sound very straightforward - will have to rethink that one. Thanks again Simon