Edit report at https://bugs.php.net/bug.php?id=62035&edit=1
ID: 62035
User updated by: incidencias at ultreia dot es
Reported by: incidencias at ultreia dot es
Summary: Problem with ProFTPd hard quotas
Status: Open
Type: Bug
Package: FTP related
PHP Version: 5.4.3
Block user comment: N
Private report: N
New Comment:
Well, you may realize that I swapped expected result and actual result.
It should be:
Expected result:
----------------
PHP Warning: ftp_put(): Transfer aborted. Disk quota exceeded.
Actual result:
--------------
PHP Warning: ftp_put(): Opening BINARY mode data connection
Previous Comments:
------------------------------------------------------------------------
[2012-05-15 09:37:36] incidencias at ultreia dot es
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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62035&edit=1