Link to home
Start Free TrialLog in
Avatar of XGenwareS
XGenwareS

asked on

PHP Upload File Without Form

I need a php script that would be able to upload a file on a pc without a form like this:

ww.mysite.com/upload.php?file=C:\myfile

is this possible?
Avatar of aqif_g
aqif_g

use POST method to submit form. This will hide URL parametres but work will goes exactly like this.

or use AJAX to send request to a file with these parameters attached. This way your page will not changes and you will remain on the same page.

regards,
aqif
Avatar of XGenwareS

ASKER

I don't want a form at all. I want just the script to be able to upload it, getting the file name from the url
Avatar of Dave Baldwin
Isn't going to happen.  PHP running on the server does not have access to your computer.
the field you chose to read a file is of type 'file'. When submit that form which contains that file, complete info of file is passed to the page in action. on that page you read all file data using $_FILE.

All values in $_File are set when form is submited. There is no other way to red that.. You can make form submission apearently transparent but you cannot do this without using form.

regards,
aqif  
ASKER CERTIFIED SOLUTION
Avatar of Lukasz Chmielewski
Lukasz Chmielewski
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
well...

if what you tried to approach is ever possible then it would obviously be a serious major security hole.