• Resolved Sam

    (@sammazza)


    I am having problem with having user download a PDF file. I have uploaded the file to an UPLOAD folder in the 2014/01/my_file.pdf. I get this error in the log:

    [09-Mar-2014 23:52:38 America/Denver] PHP Warning: readfile(www.gwcc.org.nz/wp-content/uploads/2014/01/gwcc-bylaws.pdf): failed to open stream: No such file or directory in /home4/thefarmn/public_html/gwccorg/gwcc-bylaws.php on line 10

    my php file:

    <?php
    header("Pragma: public");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Cache-Control: private",false);
    if (true) { // (!Operating_System_Is_IOS)
    	header("Content-disposition: attachment; filename=gwcc-bylaws.pdf");
    }
    header("Content-type: application/pdf");
    readfile("www.gwcc.org.nz/wp-content/uploads/2014/01/gwcc-bylaws.pdf");
    
    ?>

    In other places on my site I think I just insert an hyperlink to the file. That seems to work.

    As an aside, the error code does not tell me where on my site is the reference to the php file causing this problem. so it is quite hard to track it down. Any idea how I find where in the code or pages is the reference to the php?

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter Sam

    (@sammazza)

    submitted another request with more explanation.

Viewing 1 replies (of 1 total)
  • The topic ‘PDF download error’ is closed to new replies.