Nasr1
1 week ago
124
10
Laravel

save file outside storage

Posted 1 week 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.