Home > Invoice Plane, Open Source > InvoicePlane–Enabling friendly filenames when downloading PDF

InvoicePlane–Enabling friendly filenames when downloading PDF

Modify /application/helpers/mpdf_helper.pdf       

Look for this particular code segment

if (!empty($invoice_array) AND $isGuest) {
            rsort($invoice_array);
            header(‘Content-type: application/pdf’);
return readfile($invoice_array[0]);       

 

then modify it to

if (!empty($invoice_array) AND $isGuest) {
            rsort($invoice_array);
            header(‘Content-type: application/pdf’);
header(‘Content-Disposition: attachment; filename="’.basename($invoice_array[0]).’"’); //<– add this line
return readfile($invoice_array[0]);       

Categories: Invoice Plane, Open Source
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: