N
N. Boucher
Hi,
I have a WEB application that returns a list of .pdf documents based
on a search.
The user can selected a document by clicking on a link in the browser.
A servlet is then called to retrieved the .pdf document from the
backend storage and displayed it in the same browser window.
Below is a sample of the code I used. The problem is that the title
displayed in the browser (I am using I.E 6) is the url of that link
(for example: http://localhost/ABC/displayDoc.do?...0-1-0-^ALICE+M.+LEON417211000012285108.91)
I do not want the URL to be displayed in the browser title, In my code
I am trying to set the title to test.pdf...but it doesn't work.
Any idea what I am doing wrong?
=======================================
....
....
response.setContentType("application/pdf; name=\"test.pdf\"");
response.setHeader("Content-Disposition","
inline;filename=\"test.pdf\"");
response.setContentLength(DataBytes.length);
OutputStream out = response.getOutputStream();
out.write(DataBytes, 0, DataBytes.length);
out.flush();
out.close();
....
....
=======================================
Thanks, Nadine
I have a WEB application that returns a list of .pdf documents based
on a search.
The user can selected a document by clicking on a link in the browser.
A servlet is then called to retrieved the .pdf document from the
backend storage and displayed it in the same browser window.
Below is a sample of the code I used. The problem is that the title
displayed in the browser (I am using I.E 6) is the url of that link
(for example: http://localhost/ABC/displayDoc.do?...0-1-0-^ALICE+M.+LEON417211000012285108.91)
I do not want the URL to be displayed in the browser title, In my code
I am trying to set the title to test.pdf...but it doesn't work.
Any idea what I am doing wrong?
=======================================
....
....
response.setContentType("application/pdf; name=\"test.pdf\"");
response.setHeader("Content-Disposition","
inline;filename=\"test.pdf\"");
response.setContentLength(DataBytes.length);
OutputStream out = response.getOutputStream();
out.write(DataBytes, 0, DataBytes.length);
out.flush();
out.close();
....
....
=======================================
Thanks, Nadine