I need to upload a file from a client to the server without using a form - i.e. the client passes a filename (with full path) to the script, and the server uploads said file to a local directory...with no user interaction.
I'm not sure how to accomplish this without a form - particularly passing the filename into a variable that php can use with perhaps move_uploaded_file();
Suggestions?Different ways of doing this, using PHP's FTP functions:
<!-- m --><a class="postlink" href="http://www.php.net/manual/en/ref.ftp.php">http://www.php.net/manual/en/ref.ftp.php</a><!-- m -->
or using constructing your own HTTP POST headers using the PHP libcurl extension and using net cURL:
<!-- m --><a class="postlink" href="http://www.php.net/manual/en/ref.curl.php">http://www.php.net/manual/en/ref.curl.php</a><!-- m -->
FTP would be the easiest way to go.even with ftp how can the script access the client machine without the file button? I don't believe there is a way to do it without the file button, for security reasons.Using netCurl (as indicated in my link).
There is a Zend tutorial on this as well on their site.I still don't see it. I might be blind today but how can you enter a path eg. c:\files\file.txt and have that upload to the server in question. a user will not have an IP, well most users won't know and even if they did they don't have a webserver installed to let the other site ge tthat file in question.
if it was this easy then how come hackers are not doing it yet? they can enter any IP and get any file form a user.
I'm not sure how to accomplish this without a form - particularly passing the filename into a variable that php can use with perhaps move_uploaded_file();
Suggestions?Different ways of doing this, using PHP's FTP functions:
<!-- m --><a class="postlink" href="http://www.php.net/manual/en/ref.ftp.php">http://www.php.net/manual/en/ref.ftp.php</a><!-- m -->
or using constructing your own HTTP POST headers using the PHP libcurl extension and using net cURL:
<!-- m --><a class="postlink" href="http://www.php.net/manual/en/ref.curl.php">http://www.php.net/manual/en/ref.curl.php</a><!-- m -->
FTP would be the easiest way to go.even with ftp how can the script access the client machine without the file button? I don't believe there is a way to do it without the file button, for security reasons.Using netCurl (as indicated in my link).
There is a Zend tutorial on this as well on their site.I still don't see it. I might be blind today but how can you enter a path eg. c:\files\file.txt and have that upload to the server in question. a user will not have an IP, well most users won't know and even if they did they don't have a webserver installed to let the other site ge tthat file in question.
if it was this easy then how come hackers are not doing it yet? they can enter any IP and get any file form a user.