G
Grant Merwitz
Hi
I am currently using the Response.WriteFile, to write a pdf file to a web
browser.
This method is working fine and helping me secure the files i need to.
However, when a new window is opened and a pdf displayed, the window takes
on the title like:
http://localhost/getfile.aspx?filename=userguide.pdf
Where I would prefer the title to be userguide.pdf.
I've used the Response.AppendHeader("Content-Disposition","inline;filename="
+ FileName); to change the file name if you choose to download it instead of
opening it.
I.e. when a user click the link that opens a new window to write the file,
they get an option to save or open.
If you click save, it saves with the correct name, but if you click open,
the page title is the same as the Url.
Is there a way to set this title.
I've tried hard coding the title into the aspx page, but it still changes to
the original url.
I've also tried Response.Write("<title>some title</title>"), which then
prevents the pdf from displaying properly and gives me what looks like
hexadecimal code (or a byte array - who knows)
So, if anyone knows a solution here, it will be much appreciated
Thanks
Grant
I am currently using the Response.WriteFile, to write a pdf file to a web
browser.
This method is working fine and helping me secure the files i need to.
However, when a new window is opened and a pdf displayed, the window takes
on the title like:
http://localhost/getfile.aspx?filename=userguide.pdf
Where I would prefer the title to be userguide.pdf.
I've used the Response.AppendHeader("Content-Disposition","inline;filename="
+ FileName); to change the file name if you choose to download it instead of
opening it.
I.e. when a user click the link that opens a new window to write the file,
they get an option to save or open.
If you click save, it saves with the correct name, but if you click open,
the page title is the same as the Url.
Is there a way to set this title.
I've tried hard coding the title into the aspx page, but it still changes to
the original url.
I've also tried Response.Write("<title>some title</title>"), which then
prevents the pdf from displaying properly and gives me what looks like
hexadecimal code (or a byte array - who knows)
So, if anyone knows a solution here, it will be much appreciated
Thanks
Grant