|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-05-15 09:39 UTC] incidencias at ultreia dot es
[2012-05-15 09:48 UTC] incidencias at ultreia dot es
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 02:00:02 2025 UTC |
Description: ------------ If you try to upload a file to an FTP account in a ProFTPD server with hard quotas and available space is less than file size, transfer will be accepted receiving a "150 Opening BINARY mode data connection for <file>" response. But as soon as used space reaches quota, ProFTPD will interrupt transfer sending a "552-Transfer aborted. Disk quota exceeded." message followed by "552 STOR: notice: quota reached: '<file>' removed". PHP will know that transfer has failed but will return the first message ("Opening BINARY mode data connection") as error message instead of one of the 552 real error messages. If there is no free disk space in FTP account (which can happen if, for example, you are using ProFTPD soft quotas), ProFTPD will no initially accept the transfer sending the 150 response, so it will directly send the 552 response and everything will work OK with PHP. Test script: --------------- <?php $remote_file = $file = "myfile.bin"; $conn_id = ftp_connect("localhost"); $login_result = ftp_login($conn_id, "myuser", "mypass"); ftp_put($conn_id, $remote_file, $file, $file, FTP_BINARY); ftp_close($conn_id); Expected result: ---------------- PHP Warning: ftp_put(): Opening BINARY mode data connection Actual result: -------------- PHP Warning: ftp_put(): Transfer aborted. Disk quota exceeded.