Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > General Discussion
  New Posts New Posts RSS Feed - Content-type
  FAQ FAQ  Forum Search   Register Register  Login Login

Content-type

 Post Reply Post Reply
Author
Message
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Topic: Content-type
    Posted: 26 Jan 06 at 11:17AM
This is slightly an off topic but I think it can help others...

The thing is : from a script of mine running on a Web Server and using QuickPDF, I generate a dynamic PDF from a template.

So far so good.

Then, I want the browser to open this PDF. Also, no problem, I set this http header

Content-Type: application/pdf

And I'm done. Browser opens OK the PDF.

But, user may click on Save A Copy. Then, the file name offered is very weird and ugly. It takes a piece of the URL.

I wanna suggest him/her something better. I managed to set this too :

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


What happens next ?

1) Using FireFox, it works perfectly as intended.

2) Using MSIE, it wont recognize the filename. It keeps on using the url piece.


Have you ever faced such situation ? Am I being too "capricious" to go after such level of details ?
Back to Top
bogey View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Nov 05
Location: United States
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote bogey Quote  Post ReplyReply Direct Link To This Post Posted: 26 Jan 06 at 11:45AM

I use this and it works - except for the [1] that IE appends to the filename

 Response.ContentType = "application/pdf"
 Response.AddHeader "Content-disposition",  "inline; filename=" & timer * 100 & ".pdf"
 Response.BinaryWrite QP.SaveToVariant()

Back to Top
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Posted: 26 Jan 06 at 11:48AM
What OS are you using ?
Back to Top
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Posted: 26 Jan 06 at 11:57AM
One more thing : if your site works fine, do you think you could let me know the URL ?

If so, I could access from here and monitor if it works for my browser.

If it does, I could see a whole list of the http headers that you're using, then I would copy it (FireFox has an extension called LiveHttpHeaders that let us "see" the headers underneath).

If you dont mind, of course...
Back to Top
bogey View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Nov 05
Location: United States
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote bogey Quote  Post ReplyReply Direct Link To This Post Posted: 26 Jan 06 at 11:58AM
Browser is IE 6 on XP Pro, server is Win2K.
Back to Top
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Posted: 26 Jan 06 at 12:00PM
I have tried here upon W2K and it doesnt work either....

Back to Top
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Posted: 26 Jan 06 at 12:25PM
Hi Bogey

Thanks so much for your help !

I've received your URL privately and it works nice and perfectly as expected.

Then, I monitored the headers using FireFox LiveHttpHeaders as I said and I noticed a very subtle difference:

Your headers are specified in this order :

Content-Disposition
Content-Type

Whereas in my case, I'm issuing

Content-Type
Content-Dispositon

This appears to be the problem.

However, now I'm in a big, big problem because :

No matter the order I specify on my script, my http server ALWAYS rearranges it to that order it likes (type/disposition).

Even worse : I no longer have support to my web server, which is WebSite, which was from OReilly and for a long time has had no support at all.

But at least I could figure out where's the problem.

Seems like I'll have to be less "capricious" now and forget about it.

Once more, thank you so much 4 your help !

Hope your talk can help others web programmers too...
Back to Top
bogey View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Nov 05
Location: United States
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote bogey Quote  Post ReplyReply Direct Link To This Post Posted: 26 Jan 06 at 12:40PM

The only time I have had IE scramble up the filename is if it has invalid characters in it. Verify that you have no slashes or other punctuation in the name.



Edited by bogey
Back to Top
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Posted: 26 Jan 06 at 1:51PM
No I dont. I use a very plain and simple filename. My filename is "arquivo.pdf" which means "file.pdf".

The problem is really regarded to the order of the http headers.

Should you want, you may try to replace the order of the headers as I said above and see what happens.

Nevertheless, I'll be on vacation from tomorrow on up to February 28 th.

So, I'll be out of contact for a while.

Again, thank you so much !
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store