Answer the question
In order to leave comments, you need to log in
How to identify a problem with an FTP upload?
Good afternoon, the second day I toil with a problem - there is a server (file hosting) to which I can upload only via FTP. Everything seems to be nothing, there is a working script that, in the decodarray array cycle, logs in to the server, uploads the file and disconnects.
$file_name = '/var/www/www-root/data/www/domain.com/images/'.trim($decodarray[$i]['fname']);
$ftp_file = trim($decodarray[$i]['fname']);
$ftp = ftp_connect($ftp_server, $ftp_port, 20);
ftp_login($ftp, $ftp_user_name, $ftp_user_pass);
ftp_pasv($ftp, true);
if(!ftp_fput($ftp, $ftp_file, $file_name, FTP_BINARY)){
echo "ERROR";
}
ftp_close($ftp);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question