Hi guys!
In my application I'm using a filesystem to store files (you don't say). Currently I'm moving from the local driver to the s3 driver (using Digital Ocean Spaces) to speed things up.
Uploading works fine! Now I'm trying to figure out how the download process should be done.
Currently I have a DownloadDocumentFile controller, which does some authorisation and calls the download method of Laravel's Storage facade. I wonder if this is the way to go, because as far my knowledge goes, I think this is very inefficient since all downloaded data goes through my controller.
Another approach I've found is the temporaryUrl method, which needs an expiration stamp with it. This method will return a (pretty long) url with signatures and stuff. In this case I'd expand the timestamp with years, and save the signed url in my database.
So in closing, what is the preferred way to handle file downloads from your application using a service like S3?
Thank you for your thoughts!
Bob