mardi 23 août 2022

Is it possible to retrieve original filename from locally saved file in Laravel 5 that has been hashed

Is there a way possible to get the original file name of an already saved file that has been hashed into storage?

I can find hundreds of threads of how to get the original file name of the uploaded file, but these files have already been saved to disk with a hashed filename using $request->File->store()

My use case is that I want to create a controller that returns all saved images from disk, so the user can view them in the browser. I want to allow them to search on filenames, but all the filenames are hashed, and I can't work out how to find the original filename.

These files have not been saved into a database, they are simply sitting in the public images directory. I can use the Storage facade to retrieve Size and LastModified details, but nothing else.

Is it at all possible?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire