I am trying to use lftp to upload a file to the following php script.

<?php
   if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)){
      $msg = "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
   }
   else {
      $msg = "There was an error uploading the file, please try again!";
   }
   echo $msg;
   error_log($msg);
?>

I am using the following lftp script

debug 9
set http:put-method POST
set http:post-content-type multipart/form-data
put test.txt -o "https://www.somesite.com/uploader.php";

My test file looks like
This is a test file.

The log file on PHP always said there is an error. I looked into it
and find $_FILES never got set.

This is the log file from lftp:

---- Resolving host address...
---- 3 addresses found
---- Connecting to www.secure.com (xx.xxx.xxx.xxx) port 443
---- Sending request...
---> POST /prerelease/uploader.php HTTP/1.1
---> Host: www.secure..com
---> User-Agent: lftp/3.4.3
---> Content-Type: multipart/form-data
---> Accept: */*
---> Content-length: 22
---> Last-Modified: Tue, 28 Mar 2006 07:15:29 GMT
---> Connection: close
--->
Certificate depth: 1; subject: /C=US/O=RSA Data Security,
Inc./OU=Secure Server Certification Authority; issuer: /C=US/O=RSA
Data Security, Inc./OU=Secure Server Certification Authority
Certificate depth: 0; subject: /C=CA/ST=BC/L=Victoria/O=secure.com
Inc./OU=Web Services/OU=Terms of use at www.soltrus.com/rpa (c)
04/OU=Authenticated by Soltrus/OU=Member, VeriSign Trust
Network/CN=www.secure.com; issuer: /C=US/O=RSA Data Security,
Inc./OU=Secure Server Certification Authority
write[This is another test.
](22)
<--- HTTP/1.1 200 OK
<--- Date: Tue, 28 Mar 2006 17:01:46 GMT
<--- Server: Apache/1.3.26 (Unix) mod_ssl/2.8.10 OpenSSL/0.9.5a
<--- X-Powered-By: PHP/4.4.1
<--- Connection: close
<--- Transfer-Encoding: chunked
<--- Content-Type: text/html
<---
---- Closing HTTP connection

Any help will be greatly appreciated.

Thanks,

Newman

Reply via email to