[SOLVED] Unable to retrieve the file_size for file at location – Laravel S3

Question

This Content is from Stack Overflow. Question asked by Nadiya

I was using L5.8 for my project, and recently i changed to Laravel 9.
Here after, I’m not able to retrieve the file from Amazon S3, it shows the following error.

Unable to retrieve the file_size for file at location

This is my code to retrieve the image file

return Storage::disk('s3')->response($file_path);  

Solution

I just found out, we were using FILESYSTEM_DRIVER=s3 in previous laravel version.
But for Laravel 9, i’ve to modify it to FILESYSTEM_DISK=s3


This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 4.0.

people found this article helpful. What about you?