From 55a14f57eb2caca5aadb0e1de0de7b6e06107d31 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 8 Jan 2008 19:09:12 +0000 Subject: [PATCH] MFB: Fixed bug #43498 (file_exists() on a proftpd server got SIZE not allowed in ASCII mode). --- ext/standard/ftp_fopen_wrapper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index 0d9c12cb27..47067db854 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -775,6 +775,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f ssb->sb.st_mode |= S_IFDIR; } + php_stream_write_string(stream, "TYPE I\r\n"); /* we need this since some servers refuse to accept SIZE command in ASCII mode */ php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/")); result = GET_FTP_RESULT(stream); if (result < 200 || result > 299) { -- 2.50.1