#7121 [Opn->Csd]: fopen() doesn't owerwrite files opened via a FTP connection
| From: | pollita@php.net | Date: | Tue, 22 Apr 2003 04:15:28 +0000 |
| Subject: | #7121 [Opn->Csd]: fopen() doesn't owerwrite files opened via a FTP connection | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-38030@lists.php.net to get a copy of this message | ||
ID: 7121
Updated by: pollita@php.net
Reported By: mums at mums dot cx
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 4.0.2
New Comment:
As of PHP 5.0 this feature will be available using the ftp context
option overwrite set to any non-zero value.
<?php
$context = stream_context_create();
stream_context_set_option($context, 'ftp', 'overwrite', 1);
$fp = fopen('ftp://user:host@remoteserver.com/path/to/file',
'w',
false, $context);
?>
Previous Comments:
------------------------------------------------------------------------
[2000-10-10 11:41:31] mums at mums dot cx
I think it would be useful if one could owerwrite files also in FTP
file mode.
For an example, this won't work if the file already exists:
<?php
$fp = fopen('ftp://test:test@localhost/home/test/testfil.bin',
'w+');
fwrite($fp, 'test');
fclose($fp);
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=7121&edit=1