From: vaneay at ifrance dot com
Operating system: linux
PHP version: 5.2.5
PHP Bug Type: Filesystem function related
Bug description: file_exists() on a proftpd server got SIZE not allowed in
ASCII mode
Description:
------------
on php 5.0 and up
when trying to see if an ascii file exist on a ftp server tha follow RFC
we get the error "SIZE not allowed in ASCII mode"
example with ftp server proftpd 1.3.0 and up:
$result = file_exists('ftp://user:[EMAIL PROTECTED]/dir/file.txt');
got always $result FALSE
because in the server log the function file_exists() connect as the
following :
CONNECT
LOGIN
PASS
CWD /dir/file.txt
SIZE /dir/file.txt
550 SIZE not allowed in ASCII mode
DISCONNECT
where a normal FTP client does :
CONNECT
LOGIN
PASS
CWD /dir/file.txt
TYPE I
SIZE /dir/file.txt
213 93 <- got Size here
DISCONNECT
Reproduce code:
---------------
$result = file_exists('ftp://user:[EMAIL PROTECTED]/dir/file.txt');
Expected result:
----------------
CONNECT
LOGIN
PASS
CWD /dir/file.txt
TYPE I
SIZE /dir/file.txt
213 93 <- got Size here
DISCONNECT
Actual result:
--------------
CONNECT
LOGIN
PASS
CWD /dir/file.txt
SIZE /dir/file.txt
550 SIZE not allowed in ASCII mode
DISCONNECT
--
Edit bug report at http://bugs.php.net/?id=43498&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=43498&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=43498&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=43498&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=43498&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43498&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=43498&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43498&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43498&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43498&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43498&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43498&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=43498&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=43498&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43498&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43498&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43498&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43498&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43498&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43498&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43498&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43498&r=mysqlcfg