|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-10-10 11:41 UTC] 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);
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Jun 14 21:00:02 2026 UTC |
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); ?>