you cant send a file in a flash message !
you need to stream the file to the user instead of sending a view
Hi, I want to show my uploaded file contents in my view page. am getting the file contents in decrypted form.
Below is my controller.php:
if($ext == 'pdf' ) { $file = File::get($file); $response = Response::make($file, 200); $response = $response->header('Content-Type', 'application/pdf' ); Session::flash('message',$response); return Redirect::back(); }
and this is my view.php:
if (Session::has('message')) { {{ Session::get('message'); }} }
We can send file in flash, But we have to send in base64 encode format. this will work.
$file = $request->file('uploadfile'); $file = File::get($file); $base64= "data:"."$mime;base64,".base64_encode($file); Session::flash('message',$base64); return Redirect::back();
view.php
Please or to participate in this conversation.