Answer the question
In order to leave comments, you need to log in
Warning: ftp_fget(): Type set to A?
Good afternoon!
I'm trying to download a file from ftp, and everything seemed to work, then I changed the scripts, but it seems like everything remained as it was, it displays an error:
Warning: ftp_fget(): php_connect_nonb() failed: Operation now in progress (115) in /home/...... Warning: ftp_fget(): Type set to A. in /home/......
$ftp = ftp_connect('0000000', '10') or die ('<strong>FTP error</strong>');
$login = ftp_login($ftp, '0000', '0000');
if(!$login) exit('Ошибка подключения');
ftp_pasv($ftp, true);
$file = 'image.jpg';
$file_size = ftp_size($ftp, 'dir/'.$file);
if ($file_size != -1)
{
echo 'Файл существует<br>';
$handle = fopen('/files/new.jpg', 'w'); // файл на сервере создаётся, он пустой
if(ftp_fget($ftp, $handle, 'dir/'.$file, FTP_ASCII, 0)) // ругается на эту строку
{
echo 'Файл успешно скачан<br>';
}
else{
echo 'Ошибка скачивания файла<br>';
}
fclose($handle);
}
else{
echo 'Файл не найден<br>';
}
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