• Resolved ADvi

    (@advi)


    Plugin always opens PDF in browser instead of downloading file.
    Download option is set in plugin’s settings.
    I’m using the latest version of plugin.
    How can I solve this issue?
    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! Which browser do you use? This may be a browser setting, to always open known filetypes instead of downloading. I specifically set the headers to download for the ‘Download’ option, from there on it’s up to the browser to decide what to do with that.

    
    header('Content-Disposition: attachment; filename="'.$filename.'"');
    
    Thread Starter ADvi

    (@advi)

    Both Firefox and Chrome works as I described. Can I somehow forcibly make Download button always download invoice (and never view in browser)? I’ve used such plugin by YITH and its download buttons worked as I’ve described.

    Plugin Contributor Ewout

    (@pomegranate)

    Ah yes – confirmed.
    I have fixed this for the next update (probably released later today)

    Apologies for the inconvenience!

    Ewout

    Hi,

    I think I have the same issue.
    Firefox Mac OS and Safar Mac OS runs fine but Chrome Mac OS fails.

    Resource interpreted as Document but transferred with MIME type application/pdf: "https://www.my-site.com/wp-admin/admin-ajax.php?action=generate_wpo_wcpdf&document_type=invoice&order_ids=2413&_wpnonce=3e5f352e4d".

    Fails both options, Download or Open in browser.
    Only works if the output is HTML
    Thanks

    • This reply was modified 7 years, 4 months ago by Jairo Ochoa.
    • This reply was modified 7 years, 4 months ago by Jairo Ochoa.
    Plugin Contributor Ewout

    (@pomegranate)

    That’s odd – are you using the latest (2.0.1 or 2.0.2?)
    I use Chrome on Mac OS primarily and have not seen this error before.

    The download option should work now in 2.0.2, although I have not changed anything in the MIME type, so you may still be getting this error. application/pdf is the correct “Content-Type” afaik… If not, please enlighten me, I’d gladly fix this!

    Hi,

    The site was running WooCommerce PDF Invoices & Packing Slips 2.0.1
    Since updated to 2.0.2 it works fine again.

    Thanks

    Plugin Contributor Ewout

    (@pomegranate)

    Hello Jairo,
    Thanks for the feedback! Just to confirm – do both options (download and inline) work in 2.0.2?

    Ewout

    Hi Ewout,

    I’m afraid only works Download.
    But if I choose Inline it fails.

    Resource interpreted as Document but transferred with MIME type application/pdf: "https://www.my-site.com/wp-admin/admin-ajax.php?action=generate_wpo_wcpdf&document_type=invoice&order_ids=2413&_wpnonce=5b444d4c74f".

    • This reply was modified 7 years, 4 months ago by Jairo Ochoa.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to download PDF?’ is closed to new replies.