Page 1 of 1

PHP newbie, need help with file upload ...

Posted: Thu Jan 19, 2012 9:12 am
by assassin316
Hi,

I'm an experienced developer in desktop development, but am completely new to web technologies (except Silverlight 4). I need help uploading a file from a user's machine to my web hosting server. Here's my scenario:

I have a Silverlight application which saves a temporary image to the My Documents folder. I need a PHP script which will take this image (a JPG image) and copy it to a server folder (without any use of a web form).

Can anyone point me to a good tutorial that shows this? I cannot find one. They all use Form/Submit buttons, and I can't have that.

Also, does this functionality require both client-side and server-side scripts, or just server-side?

Thank you for your time!

Max

Re: PHP newbie, need help with file upload ...

Posted: Fri Jan 20, 2012 12:41 pm
by twinedev
I think you need to clarify what you mean by "without any use of a web form". Do you mean that you want it to just grab a known filename from a known location?

If you are talking about using PHP as a script running on your web server, you will need some interactivity or at least a program written on your computer to submit the file to your server. This is because of security issues (image if you browse to a site and it could just read and grab any file it wanted off of your system...)

At the very least I would see a form that has only the File select input and a submit, so the user can pick the file, but you say you don't want any type of form. So there you are back to needing a custom program to run on the client system to send it to the server. (in which case, why not just do FTP?)

-Greg