J
JonCourt
HI
I have a problem specific to IE when I download a pdf
document (or any other binary type) and use the Content-
Disposition header to force a file download dialogue to
appear. When I save the document from the dialogue box
the document object of the frame used to submit the print
url no longer exists.
This problem only occurs when the save option is
selected, NOT when the view option is selected. It also
only occurs if I immediately click print again, if the
affected frame (main) is resubmitted the document object
is formed again (as expected) and the print works.
I'm using the following link to download a PDF document.
Note it calls to another frame.
<a target="hidden" href="#" onClick="top.frames
['main'].submitForPrint(); return true;"\>[an image]</a>
Where the submitForPrint method is as follows. This is
the method that fails because the document object is null
after a save operation during a previous download:
submitForPrint()
{
document.aForm.action=[pdf_url];
document.aForm.submit();
}
And the response headers are:
Content-Type: application/pdf
Content-Disposition: attachment; filename=fileName.pdf
Has anyone else encountered this problem and have they
found a way around please?
Regards
Jon Court
I have a problem specific to IE when I download a pdf
document (or any other binary type) and use the Content-
Disposition header to force a file download dialogue to
appear. When I save the document from the dialogue box
the document object of the frame used to submit the print
url no longer exists.
This problem only occurs when the save option is
selected, NOT when the view option is selected. It also
only occurs if I immediately click print again, if the
affected frame (main) is resubmitted the document object
is formed again (as expected) and the print works.
I'm using the following link to download a PDF document.
Note it calls to another frame.
<a target="hidden" href="#" onClick="top.frames
['main'].submitForPrint(); return true;"\>[an image]</a>
Where the submitForPrint method is as follows. This is
the method that fails because the document object is null
after a save operation during a previous download:
submitForPrint()
{
document.aForm.action=[pdf_url];
document.aForm.submit();
}
And the response headers are:
Content-Type: application/pdf
Content-Disposition: attachment; filename=fileName.pdf
Has anyone else encountered this problem and have they
found a way around please?
Regards
Jon Court