Bug #16058 Updated: ftp_get() try to create temp file in the c:\
| From: | sniper@php.net | Date: | Thu, 11 Jul 2002 03:08:37 +0000 |
| Subject: | Bug #16058 Updated: ftp_get() try to create temp file in the c:\ | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13800@lists.php.net to get a copy of this message | ||
ID: 16058
Updated by: sniper@php.net
Reported By: alexf@spiralsolutions.com
-Status: Open
+Status: Closed
Bug Type: FTP related
Operating System: Win2K
PHP Version: 4.1.2
New Comment:
Just use ftp_fget() as you can give it a filepointer you have opened
wherever you wish:
http://www.php.net/manual/en/function.ftp-fget.php
(and regarding tmpfile(), it should store the temporary file in
whatever your TEMP is set to?)
Not really any bug.
Previous Comments:
------------------------------------------------------------------------
[2002-03-14 03:18:57] alexf@spiralsolutions.com
OS - Win2K, IIS, PHP.
If i use NTFS on my C drive under Win2K, and try to get file over ftp
using ftp_get(), ftp_get() fails.
The problem is in C code in php_ftp.c:
C function tmpfile(), that used for creation of temporary files, try to
create this file on C:\ (in the root directory, according to C docs):
================ Source code from php_ftp.c ===============
/* get to temporary file, so if there is an error, no
existing file gets clobbered
*/
if ((tmpfp = tmpfile()) == NULL) {
php_error(E_WARNING, "error opening tmpfile");
RETURN_FALSE;
}
===========================================================
But, for security reasons, root directory can't be writable by
Anonymous user, so ftp_get() fails.
ftp_get() work only if we have c:\ world writable.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16058&edit=1