Laravel getID3 unable to pull file from S3

user8310317

I've finally gotten to testing external file storage systems in my project and I'm encountering a strange error when I try to analyze some of these files.

What I'm trying to achieve: Grab a list of all the files in a certain s3 directory (done) and analyze them by their ID3 tags using a php package:

https://packagist.org/packages/james-heinrich/getid3

$files = Storage::disk('s3')->files('going/down/to/the/bargin/basement/because/the/bargin/basement/is/cool'); //Get Files
$file = Storage::disk('s3')->url($files[0]); // First things first... let's grab the first one.
$getid3 = new getID3; // NEW OBJECT! 
return $getid3->analyze($file); // analyze the file!

However when I throw that into tinker it squawks back at me with:

"GETID3_VERSION" => "1.9.14-201703261440",
 "error" => [
   "Could not open "https://a.us-east-2.amazonaws.com/library/pending/admin/01%20-%20Cathedrals.mp3" (!is_readable; !is_file; !file_exists)",
 ],

Which seems to indicate that the file is not readable? This is my first time utilizing AWS S3 so there may be something I haven't configured correctly.

Usama Ejaz

The problem is that you are passing URL to analyze method. This is mentioned here.

To analyze remote files over HTTP or FTP you need to copy the file locally first before running getID3()

Ideally, you will save the file from your URL locally and then pass to getID3->analyze()

// save your file from URL ($file)
// I assume $filePath is the local path to the file
$getID3 = new getID3;
return $getID3->analyze($filePath); // $filePath should be local file path and not a remote URL

To save an s3 file locally

$contents = $exists = Storage::disk('s3')->get('file.jpg');
$tmpfname = tempnam("/tmp", "FOO");
file_put_contents($tmpfname, $contents);
$getID3 = new getID3;
// now use $tmpfname for getID3
$getID3->analyze($tmpfname);
// you can delete temporary file when done

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to pull a variable file from S3 in Ansible

From Dev

Unable to fetch file from s3 with api

From Dev

AWS Lambda unable to GET a file from S3

From Dev

Unable to download a file from S3 by the URL in a browser

From Dev

getid3: download the full mp3 data from remote server

From Dev

Download file from cloud disk (S3) with Laravel 5.1

From Dev

How to stream an large file from S3 to a laravel view

From Dev

Retrieve tags from a file in AWS S3 with Laravel

From Dev

Display image in browser with getID3

From Dev

getId3 to get video duration in seconds

From Dev

Unable to Reference a S3 file in Terraform

From Dev

Laravel and AWS PHP SDK - Unable to delete a local file after it was uploaded to S3

From Dev

How to use getid3 if installed with apt-get install getid3?

From Dev

Unable to restore SQL Server bak file from S3, says file too large

From Dev

Unable to download file from s3 using return response()->download($file);

From Dev

Download S3 file links in Laravel

From Dev

Unable to upload file from Elastic Beanstalk to s3 due to access denied

From Dev

How to read an .xls file from AWS S3 using spark in java? And unable to read sheetName

From Dev

Unable to Parse JSON file from S3 in AWS Quick Sight

From Dev

Unable to access S3 file with IAM role from EC2

From Dev

Unable to read csv file present in S3 from Sagemaker R studio

From

Get file's signed URL from amazon s3 using Filesystem Laravel 5.2

From Dev

Fab file, unable to remote curl a S3 .gzip file

From Dev

How to upload image file to Stripe from Amazon S3 using Laravel 5.5 and Intervention Image

From Dev

How to read file from s3?

From Dev

Importing a file into jupyterlabs from s3

From Dev

Delete a file from s3 bucket

From Dev

query from athena a file in s3

From Dev

Access Zip File from S3

Related Related

  1. 1

    How to pull a variable file from S3 in Ansible

  2. 2

    Unable to fetch file from s3 with api

  3. 3

    AWS Lambda unable to GET a file from S3

  4. 4

    Unable to download a file from S3 by the URL in a browser

  5. 5

    getid3: download the full mp3 data from remote server

  6. 6

    Download file from cloud disk (S3) with Laravel 5.1

  7. 7

    How to stream an large file from S3 to a laravel view

  8. 8

    Retrieve tags from a file in AWS S3 with Laravel

  9. 9

    Display image in browser with getID3

  10. 10

    getId3 to get video duration in seconds

  11. 11

    Unable to Reference a S3 file in Terraform

  12. 12

    Laravel and AWS PHP SDK - Unable to delete a local file after it was uploaded to S3

  13. 13

    How to use getid3 if installed with apt-get install getid3?

  14. 14

    Unable to restore SQL Server bak file from S3, says file too large

  15. 15

    Unable to download file from s3 using return response()->download($file);

  16. 16

    Download S3 file links in Laravel

  17. 17

    Unable to upload file from Elastic Beanstalk to s3 due to access denied

  18. 18

    How to read an .xls file from AWS S3 using spark in java? And unable to read sheetName

  19. 19

    Unable to Parse JSON file from S3 in AWS Quick Sight

  20. 20

    Unable to access S3 file with IAM role from EC2

  21. 21

    Unable to read csv file present in S3 from Sagemaker R studio

  22. 22

    Get file's signed URL from amazon s3 using Filesystem Laravel 5.2

  23. 23

    Fab file, unable to remote curl a S3 .gzip file

  24. 24

    How to upload image file to Stripe from Amazon S3 using Laravel 5.5 and Intervention Image

  25. 25

    How to read file from s3?

  26. 26

    Importing a file into jupyterlabs from s3

  27. 27

    Delete a file from s3 bucket

  28. 28

    query from athena a file in s3

  29. 29

    Access Zip File from S3

HotTag

Archive