G
G
Greg Popov2017-12-26 18:25:00
PHP
Greg Popov, 2017-12-26 18:25:00

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;
}

It gives an error: `Warning: ftp_put(): User logged in.`
And it does not google, I can not find anything on it in the dock. Who will tell what?
Thanks in advance.
UPD: tested on ubuntu FTP, everything is ok, on screw FTP - problems.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question