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!
Content-type |
Post Reply |
Author | |
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
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 ? |
|
bogey
Senior Member Joined: 30 Nov 05 Location: United States Status: Offline Points: 50 |
Post Options
Thanks(0)
|
I use this and it works - except for the [1] that IE appends to the filename Response.ContentType = "application/pdf" |
|
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
|
What OS are you using ?
|
|
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
|
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... |
|
bogey
Senior Member Joined: 30 Nov 05 Location: United States Status: Offline Points: 50 |
Post Options
Thanks(0)
|
Browser is IE 6 on XP Pro, server is Win2K.
|
|
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
|
I have tried here upon W2K and it doesnt work either....
|
|
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
|
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... |
|
bogey
Senior Member Joined: 30 Nov 05 Location: United States Status: Offline Points: 50 |
Post Options
Thanks(0)
|
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 |
|
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
|
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 ! |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store