NetTalk Central
NetTalk Web Server => Web Server - Share Knowledge => Topic started by: Bruce on July 11, 2008, 07:15:06 AM
-
One question that has come up a couple times on this forum is how to change the name, prompted by the browser, when the user is saving a file to disk.
Take Example 40, as an example. This example shows you how to download a document, where the document name is passed as a parameter to a generic page. For example;
GET /ServeDocument?name=test.xls
In version 4.30 and earlier, the prompted name to save the file would be "ServeDocument". Most people would prefer for it to prompt as "test.xls".
Previously I've stated that it wasn't possible to do this, and I'm happy to say, I was wrong. It is possible. It's done by setting the content-disposition header field.
So with Version 4.31, PR6 or later, see example 40 (in the embed code in the ServeDocument procedure) for an example of how this is done.
Thanks to Robert De Jager who first showed me the technique.
Cheers
Bruce
-
Hi Bruce,
This technique works OK on my old Windows 2000 with IE6 but not in IE7 vista.
In IE6 I see the name of the proc as the name of the file, thats ok.
In IE7 I see the coplete path of the file!
Any Idea?
Regards
Alberto
-
It displays whatever you set in the content-disposition header.
So in the example it's setting the full pathname - but you can set it to whatever you like.
cheers
Bruce