@ryanmortier I upload files to S3 and files are only viewable via a signed URL. The signed URL is only generated if the authenticated user is actually allowed to view that file in the first place: https://laravel.com/docs/8.x/filesystem#temporary-urls
How do you securely embed user uploaded images or allow downloading of a user uploaded file?
When a user uploads a file and you store it, to then display it back to the user I've been embedding the link to the image like an asset. The problem is that the web server now handles this and it skips PHP/Laravel altogether which means no authentication/authorization. The file does have a hash (md5?) for the file name which means for a user to try to find other user uploaded files would take a lot of time, though not impossible.
How are you guys embedding user uploaded images and still checking if the image can be shown with Laravel auth?
Is there a Laracasts video anyone can link me on this?
@ryanmortier I used an adaptacion of: https://laravel.io/forum/04-23-2015-securing-filesimages
Of course I modified as needed.
Please or to participate in this conversation.