setIconTitle("fa fa-home"); return view('home'); } public function uploadThis(Request $request) { $this->validate($request, [ 'file' => 'required', ]); $file = $request->file('file'); $fileContent = $file->get(); // echo 'File Name: '.$file->getClientOriginalName(); // echo 'File Extension: '.$file->getClientOriginalExtension(); // echo 'File Real Path: '.$file->getRealPath(); // echo 'File Size: '.$file->getSize(); // echo 'File Mime Type: '.$file->getMimeType(); // Encrypt File $encryptedContent = encrypt($fileContent); \Storage::put('file.dat', $encryptedContent); } public function downloadThis(Request $request) { // Decrypt File $encryptedContent = \Storage::get('file.dat'); $decryptedContent = decrypt($encryptedContent); return response()->streamDownload(function() use ($decryptedContent) { echo $decryptedContent; }, 'file.jpg'); } }