[Filesystem] Add FTP stream wrapper context option to enable overwrite (override)
This commit is contained in:
parent
2c9496bc77
commit
c056a9c426
@ -50,7 +50,8 @@ class Filesystem
|
||||
if ($doCopy) {
|
||||
// https://bugs.php.net/bug.php?id=64634
|
||||
$source = fopen($originFile, 'r');
|
||||
$target = fopen($targetFile, 'w');
|
||||
// Stream context created to allow files overwrite when using FTP stream wrapper - disabled by default
|
||||
$target = fopen($targetFile, 'w', null, stream_context_create(array('ftp' => array('overwrite' => true))));
|
||||
stream_copy_to_stream($source, $target);
|
||||
fclose($source);
|
||||
fclose($target);
|
||||
|
Reference in New Issue
Block a user