Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to upload file without using upload control, then the file path is given in queryString.
For Ex: (http://somesite.com/fileup.php?file=d:/folder1/file1.png)

Any possibilities is there means help me plz.

Thanks in advance.....!
Posted
Comments
Afzaal Ahmad Zeeshan 25-Nov-14 7:19am    
Get the upload request type of POST instead of GET.

This wouldn't work because a path like "d:/folder1/file1.png" is local to the browser (user) and not accessible for the web-server. It would be a major security risk if something like that would be possible.

Good luck!
 
Share this answer
 
Comments
sathish4303 25-Nov-14 7:20am    
there is ant other way to upload file using only webrequest...?
Find out the proper way of uploading file in php from
PHP 5 File Upload[^]
 
Share this answer
 
v2
It's not possible because of security reasons! And that is why the "form control" doesn't send the full path of the file to the server (just the file name is sent).
 
Share this answer
 
Comments
sathish4303 26-Nov-14 1:28am    
give me an example plz....
Oso Oluwafemi Ebenezer 26-Nov-14 2:03am    
Ok! The only way to upload a file using query string is if you already have the base64 encoded string of the file content. You can then do http://127.0.0.1/whatever.php?file1=dgryy23xg... and decode the base64 on the server side.
E.F. Nijboer 26-Nov-14 7:19am    
Be aware that this abuses a get request, therefor not secure and has a limit of +/- 2kb (depending on the browser used by the client and the maximum size of the get request accepted by the server).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900