Monday, November 13th, 2006...3:08 pm

There was an error opening this document. This file cannot be found.

Jump to Comments

This error sucks. Acrobat Reader 7 throws it when trying to read an inline PDF in IE.

Here's how you fix it (in java, though you could do this in another language, point is you have to set your headers like so).

response.setHeader("Pragma", "public");
response.setDateHeader("Expires", 0);
response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
response.setHeader("Cache-Control","public");
response.setHeader("Content-Description","File Transfer");

6 Comments

  • Why oh why does Acrobat suck so hard?

    Anyway, there's a lot to be said for Foxit reader.

  • Only setting Cache-Control to public works.
    Use:
    response.setHeader("Cache-Control","public");
    response.setContentType("application/pdf");
    response.setHeader("Content-Disposition", "attachment;filename=Test.pdf");

  • Thanks You So much...

    You have solved my big Problem.

    Thanks a ton again.

    Ajay

  • Thank you!

    One of the apps I maintain was fine with ie6 (adobe 8) and ie7/ie8(adobe 8 or 9) yet, ie6 and adobe 9 was causing the 'There was an error opening this document. This file cannot be found' message.

    We had been using

    response.setHeader("Cache-Control", "no-store");

    but replacing it with your suggested

    response.setHeader("Cache-Control", "public");

    seemed to fix the issue, without breaking the other browser combos.

    Thank you 1000x sir

  • We are facing the same issue in Adobe Reader 9. The above code didn't help us.

    Note: The problem occurs only if we are not opening the file in browser. If we open in the browser itself (inline), it works well.

    Please let me know if you have any suggestions.

    Regards,
    K.P

  • The issue got resolved with the setting 'Cache-Contro' to 'private' in httpd.conf

    Thanks
    K.P

Leave a Reply