soarecostin / file-vault

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

Error while encryting a file to s3 #29

Open UsamaKhan-hub opened 1 year ago

UsamaKhan-hub commented 1 year ago

Hello, what i am doing is basically i am uploading files on s3 as encrypted , it's working fine but when i tried to decrypt any specific file and create a presignedUrl (which i get and is accessible) and then i created a job to run after a while to again encrypt that specific file , jobs gets failed and it throws me this error : Error: Call to undefined method League\Flysystem\Adapter\Local::getClient() in /vendor/soarecostin/file-vault/src/FileVault.php:192 Stack trace:

Sometime it works but most of time not. If someones guide me regarding this. My code is as follow : To create a url : $presignedUrl=$client->getAwsTemporaryUrl($client->getDriver()->getAdapter(), $key, now()->addSeconds(15), []);

To decrypt the file again : EncryptAttachment::dispatch($key1) ->onQueue('queue4') ->delay(now()->addSeconds(15)); and also i am specifying my disk as well in that job as well FileVault::disk('s3')->encrypt($this->key);