soarecostin / file-vault

A Laravel package for encrypting and decrypting files of any size
MIT License
184 stars 63 forks source link

Help retrieving uploaded file #22

Open movepixels opened 2 years ago

movepixels commented 2 years ago

I cant download / find the image once uploaded.

For testing purposes made the file public and if manually type the url into the browser it downloads the file, so it's there.

$file = 'https://media.xxxxxxx.com/development/verification/3729828c-4d69-11ec-866b-7f65ebec3fd0/0611fdf9-70e4-4b3f-b33c-bc430fa6d48c.jpg.enc';

    if (!\Storage::disk('spaces')->has($path)) {
        return 'File not found';
    }

Always never found

exception: "Illuminate\Contracts\Filesystem\FileNotFoundException" file: "/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php" line: 159 message: "File not found at path: https:/media.xxxxxxxxx.com/development/verification/3729828c-4d69-11ec-866b-7f65ebec3fd0/0611fdf9-70e4-4b3f-b33c-bc430fa6d48c.jpg.enc"

But other than not finding the file, how can I view the image. The encrypted files are all images so basically the user uploads 3 images, it get encrypted, admin needs to review these images so they need to see it on the admin section of the site. How is this possible?

I do not want to download the image in the browser, simply pull the encrypted file, decrypt it and return a base_64 image to the browser in an API json response?