HI,
I have follow problem. I want upload a file to a map on a ftp server.
I make a connection to a ftp server. That's ok.
Then I make a directory
ftp_chdir($conn _id,"/public_html/info"); //ok
if(ftp_mkdir($c onn_id,"uploads ")) print ("File is created!"); //ok
ftp_chdir($conn _id,"/public_html/info/uploads"); //ok ?????
$source_file = $_FILES['userfile']['name']; //ok exist (is a file from
the local drive
$destination ="/public_html/info/uploads"; //I think that's the map I make
$upload = ftp_fput($conn_ id, $source_file , $destination_fi le, FTP_BINARY);
print $upload gives false
The error in the browser :
File is created!
/public_html/info/uploads
Warning: ftp_fput() expects parameter 3 to be resource, string given in
/home/school/public_html/result.php on line 37
FTP upload has failed!
What's wrong?
thxt,
Alain
I have follow problem. I want upload a file to a map on a ftp server.
I make a connection to a ftp server. That's ok.
Then I make a directory
ftp_chdir($conn _id,"/public_html/info"); //ok
if(ftp_mkdir($c onn_id,"uploads ")) print ("File is created!"); //ok
ftp_chdir($conn _id,"/public_html/info/uploads"); //ok ?????
$source_file = $_FILES['userfile']['name']; //ok exist (is a file from
the local drive
$destination ="/public_html/info/uploads"; //I think that's the map I make
$upload = ftp_fput($conn_ id, $source_file , $destination_fi le, FTP_BINARY);
print $upload gives false
The error in the browser :
File is created!
/public_html/info/uploads
Warning: ftp_fput() expects parameter 3 to be resource, string given in
/home/school/public_html/result.php on line 37
FTP upload has failed!
What's wrong?
thxt,
Alain
Comment