Answer the question
In order to leave comments, you need to log in
Why does FTP upload the archive fail?
Trying to upload a .zip file to FTP using PHP.
function exportToFtp($zipPath, $zipname)
{
$response = null;
$connection = ftp_connect(FTP_HOST, 21);
if($connection) {
$login_result = ftp_login($connection, FTP_USER, FTP_PASSW);
ftp_pasv($connection, true);
if($login_result) {
$response = ftp_put($connection, 'E://path/to/folder' . $zipname, $zipPath, FTP_BINARY);
}
ftp_close($connection);
}
return $response;
}
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