Solved

PHP Upload File Without Form

Posted on 2010-09-01
6
629 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:XGenwareS
6 Comments
 
LVL 3

Expert Comment

by:aqif_g
ID: 33582990
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
0
 

Author Comment

by:XGenwareS
ID: 33583102
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
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 33583331
Isn't going to happen.  PHP running on the server does not have access to your computer.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 3

Expert Comment

by:aqif_g
ID: 33583362
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  
0
 
LVL 27

Accepted Solution

by:
Lukasz Chmielewski earned 500 total points
ID: 33584707
Not possible. PHP is server - side language, it cannot see anything beside the resident server. Java environment would be able to do this.
0
 
LVL 5

Expert Comment

by:onemadeye
ID: 33585018
well...

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

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question