The error message indicates that Laravel's Flysystem library is unable to retrieve the metadata for the file you're trying to download. Specifically, it's unable to retrieve the file size for the file located at the given path.
There could be several reasons why Flysystem is unable to retrieve the metadata, but some common causes include:
The file doesn't exist at the given path.
The file exists, but the web server doesn't have permission to read it.
To troubleshoot the issue, you can try the following:
Check that the file exists at the given path by running file_exists(storage_path("app/".$this->pdf->{File::PATH})) before attempting to download it.
Check the permissions on the file and its parent directories to ensure that the web server has permission to read the file.
I have finally solved, like this. The browser will handle the file download. So I just made a redirect to the file url so the browser starts downloading.
I am having the same problem but I am using the local driver. So this solution just outputs the string of the file path. it doesn't open the file. Pls any ideas?