download documents

Posted 5 days ago by komal27

public function storeDocument(Request $request) {

        $title      = $request->title;
        $user_id    = $request->user_id;
        $file=$request->file;
        $imageName=time().'.'.$request->file->getClientOriginalExtension();
        //Encryption
        $encryptedFile = Crypt::encrypt(file_get_contents($request->file->getRealPath()));
        Storage::put($imageName, $encryptedFile);

        $documents=new Document();
        $documents->Title=$title;
        $documents->doc=$imageName;
        $documents->user_id=$user_id;
        $documents->save();
        return redirect()->action('[email protected]',$documents->user_id);

    }

now i want to download documents from this path how would i do this?

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