Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

surreal's avatar

Copy folder and its content to storage

Hi there, is there any sollution to copy an entire folder (including foldername) and its content to another storage disk (ftp) without manually creating the folder first and loop through the files within this folder? Is it possible that copyDirectory() is only working when source and direction are only locally?

edit:

$copy_dir=\File::copyDirectory($sourcefolder, Storage::disk('remoteftp')->path('test'));

returns true but the test folder is empty

0 likes
2 replies
programators's avatar

What about specifying full path for both source and destination folders ?

Please or to participate in this conversation.