Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

225
Views
Move images from one server to s3 PHP Laravel 5.3

I'm trying to write a script where I'm trying to move images from an old server to Amazon s3. Is it possible to do by downloading the image from an url?

$companies = Company::all();

$companies->each( function ($company) {

    //some method to download file
    $file = download($company->logo);

    //Store on s3
    $filename = $file->storeAs('images', uniqid('img_') . "." . $file->guessClientExtension(),'s3');

    //Get the new path
    $new_path = Storage::disk('s3')->url($filename);

    //save the new path to logo
    $company->logo = $new_path;

    //save the new path
    $company->save();
}
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can use this library Php League FileSystem

It has an integration for laravel and other framewoks such as zend, Cake etc

The library has an adapter for amazon S3 V2 and amazon s3 V3

Full documentation here

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!