Solved

PHP Upload File Without Form

Posted on 2010-09-01
6
632 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

856 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