• Resolved sjain

    (@sjain)


    Hi,
    We are using this plugin to share a PDF with the visitors. The plugin works fine and visitors are receiving the email. But the downloaded file is either corrupted or some other error is there as no software is able to open the PDF. We have rechecked and the file it is not corrupted initially.

    Also, different users are receiving different file sizes.

    Please suggest something ASAP.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor gopiplus

    (@gopiplus)

    File : wp-content\plugins\email-download-link\job\ed-downloads.php

    Your server may not support curl option. we are using this method to create download. Please check the above mentioned file and change the code that match your server.

    I was able to fix it by adding the line

    curl_setopt($ch, CURLOPT_USERAGENT, “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36”);

    Without the user agent set, I was basically downloaded a “400 Bad Request Error”.

    For anyone having the same problems with PDFs being corrupted:

    In wp-content\plugins\email-download-link\job\ed-downloads.php, change

    header('Content-Type: application/force-download'); (line 58 for me)

    to:

    header('Content-Type: application/pdf');

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unsupported PDF download’ is closed to new replies.