Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PHP Upload File Without Form

Posted on 2010-09-01
6
Medium Priority
?
648 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 84

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
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

 
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 2000 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

Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

618 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