AvadhutBhangui

Hi All,

I am facing a strange problem with 'content-disposition' header. In my application i will publish some PDF documents which will be available for the end users for viewing/downloading purpose. Our aim is that when a user clicks on the link we open the document in the right pane of the browser window and also provide a proper filename in the 'save as' dialog box if user does a right click and selects 'save target as' option from the menu.

We could achieve this by using the 'content-disposition' header. We used the header as follows:

"Content-Disposition: inline; filename=test_file.pdf;".

But now we are facing a strange issue. The filename we populate above is generated dynamically and if this name contains the word "attachment" IE instead of opening the document inline pops up the "File Download" dialog box.

In this situation the header looks as shown below:

"Content-Disposition: inline; filename=test_attachment.pdf;".

If i remove this word "attachment" from the 'filename' part of the header above things work as expected.

As per my understanding the "File Download" dialog box should have been poped out if and only if i had specified the disposition method as 'attachment' .i.e. if i had used the content-disposition header as follows:

"Content-Disposition: attachment; filename=test_file.pdf;".

I am using IE6.0 with SP2. The above behavior can be seen with both Acrobat Reader 6.0 and 7.0 plugins for IE.

Any suggestions

Thanks,

Avadhut.



Re: Internet Explorer Web Development Internet Explorer and Content-Disposition header

AvadhutBhangui

Hi All,

Please let me know if i have posted this issue at wrong place. I am surprised that nobody has given any suggestions till now. Do let me know if i need to move this thread in some other forum I m really in need of some suggestions on this issue.

Thanks,

Avadhut.





Re: Internet Explorer Web Development Internet Explorer and Content-Disposition header

dana adams

Try:

Content-Disposition: inline; filename="test_attachment.pdf";

instead of Content-Disposition: inline; filename=test_attachment.pdf; - the quotes may properly isolate the file name




Re: Internet Explorer Web Development Internet Explorer and Content-Disposition header

Sliffy

According to RFC 2183, "filename" is only to be used when there is an attachment.

And if you're opening the file inside a frame, i'm not sure why the filename is important