1

I have to move large content, which I don't want to put into memory from AWS S3 to FTP with Laravel's filesystem.

I know how to stream local content to S3, but haven't found a solution yet from S3 to FTP.

The closest I found was this, but I'm stuck in adapting it for my case.

Here is what's missing in my code (??):

$inputStream = Storage::disk('s3')->getDriver()->??
$destination = Storage::disk('ftp')->getDriver()->??

Storage:disk('ftp')->getDriver()->putStream($destination, $inputStream);
theother11
  • 71
  • 2
  • 6

1 Answers1

5

I think I found a solution:

$input = Storage::disk('s3')->getDriver();
$output = Storage::disk('ftp')->getDriver();

$output->writeStream($ftp_file_path, $input->readStream($s3_file_path));
theother11
  • 71
  • 2
  • 6