8 months ago

save file outside storage

Posted 8 months ago by Nasr1

i need to save the file outside storage, by a user give path i know there is storeAs method but i cant use it, because i am encrypting the file, so i can't use storeAs :/ is there any other easy way this is my code

                //get file
                $file = $request->file('fileToEncrypt');
                //encrypt file
                try {
                    $fileContent = $file->get();
                } catch (FileNotFoundException $e) {
                    return 'File Not Found';
                // Encrypt the Content
                $encryptedContent = encrypt($fileContent);

                //store file in path that was given

Please sign in or create an account to participate in this conversation.