|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
file upload problem - Warning: ftp_put(): error opening ...
I'm writing an upload script to upload directly to a remote server. It seems to connect ok but I can't 'put' the file.
This is the error: Warning: ftp_put(): error opening in /home/virtual/site279/fst/var/www/html/fileupload3/upload.php on line 24 Here is my code <?php $ftp_server="glasswing.com"; $conn_id = ftp_connect($ftp_server); $user="XXX"; $passwd="FOO"; $login_result = ftp_login($conn_id, $user, $passwd); if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; die; } else { echo "Connected to $ftp_server, for user $user"; } //directorylike /www.velibaba.com/images //ftp_chdir($conn_id, "www.velibab.com"); //ftp_chdir($conn_id, "compimages"); //$destination_file=ftp_pwd($conn_id); $destination_file="x.jpg"; echo (""); print $destination_file; echo (""); // upload the file $source_file = $_POST['userfile']; $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); // check upload status if (!$upload) { } else { echo "Uploaded $source_file to $ftp_server as $destination_file"; } // close the FTP stream ftp_close($conn_id); ?> Thanks! |
|
#2
|
||||
|
||||
|
Have you checked out this link?
http://www.php.net/manual/en/function.ftp-put.php Try the suggestions on that page. Hopefully that will help you. |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > file upload problem - Warning: ftp_put(): error opening ... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|