What errors do you get?
What are you passing as pdf_file
Your path looks wrong if your pdfs are in public
elite123 said:
What errors do you get?
What are you passing as pdf_file
Your path looks wrong if your pdfs are in public
yeah i don't know what the problem is i used if i changed it to public/image/pdf the error would be
file_get_contents(public/image/pdf/var/www/fsr/storage): failed to open stream: No such file or directory
it has var/www/fsr/storage
This code is useful for every extension of file, will show. just change your path as per your storage dir
/**
* @param int $id
* @param string $docs
* @return \Illuminate\Http\Response
*/
..public function showTenderDocs($id, $docs)
..{
..$filename = "/images/tender_docs/".$id.'/'.$docs;
..$path = base_path($filename);
..$contentType = mime_content_type($path);
..return Response::make(file_get_contents($path), 200, [
.. 'Content-Type' => $contentType,
..'Content-Disposition' => 'inline; filename="'.$filename.'"'
..]);
..}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community