madala
230
1
Laravel

blank pdf

Posted 1 year ago by madala
$attachment =BudgetAttachment::where("attachment_id",$attachmentId)->get();
    $fileName =$attachment[0]->attachment_name;
    $fileContent=$attachment[0]->attachment_content;
    $fileSize=$attachment[0]->attachment_size;
    $fileType =$attachment[0]->attachment_type;
    $fileMime =$attachment[0]->attachment_mime;
    header("Content-length: ".strlen($fileContent));
    header("Content-disposition: attachment; filename=\"".$fileName."\"");
    header("Content-type: $fileMime");
    echo $fileContent;

when i try to download pdf file it show blank pdf.

can any one help me with this.

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