sobee-rpg
asked on
ASP - Reponse.Redirect - To open a PDF file
I have an asp page which takes the input and gets a PDF file and opens it.
I have used Response.redirect("http://temp/a.pdf") or Response.redirect("./temp/ a.pdf")
Only in some systems it is getting opened directly.
in other systems it is not opening the pdf, just showing a blank page.
In those systems if delete the http in the addressbar and if press enter , then it is opening the PDF file
What will be the reason ?
How to make them open automatically in those systems.
Thanks
Sobee
I have used Response.redirect("http://temp/a.pdf") or Response.redirect("./temp/
Only in some systems it is getting opened directly.
in other systems it is not opening the pdf, just showing a blank page.
In those systems if delete the http in the addressbar and if press enter , then it is opening the PDF file
What will be the reason ?
How to make them open automatically in those systems.
Thanks
Sobee
ASKER
but my file name changes every time
how to put the file name which i get from the previous page on to the onload event of this page
how to put the file name which i get from the previous page on to the onload event of this page
Try using
Server.Transfer FileName
Server.Transfer FileName
<body onload="window.document.lo cation = '<%=Request.Form("file_nam e")%>'">
set a veriable first.
<%
dim myPDF
myPDF = request.querystring("filen ame")
myPDF="http://temp/" & myPDF
response.redirect myPDF
%>
if this doesn't help, post your code so I can get a better understanding of how you are doing this.
<%
dim myPDF
myPDF = request.querystring("filen
myPDF="http://temp/" & myPDF
response.redirect myPDF
%>
if this doesn't help, post your code so I can get a better understanding of how you are doing this.
ASKER
I tired with all these command.
In some system it is working . In some system it is giving a blank page
Im my ASP page I just get a file name of a particular pdf file and redirect to it's location.
Whether it is has some thing to do with IE version or OS ?
Thanks
Sobee
In some system it is working . In some system it is giving a blank page
Im my ASP page I just get a file name of a particular pdf file and redirect to it's location.
Whether it is has some thing to do with IE version or OS ?
Thanks
Sobee
Do all the PC's that you are trying this from have Adobe Acrobat reader installed?
ASKER
Yes
Just now i went into acrobat site.
He says to change the preferences in Acrobat. By removing web browser integration.
If i do that i not getting the pdf opened in IE.
I tried this one in a machine which was already opening the page in IE
but after trying this (Changed back to prev preferences), that system too not opening the pdf now .
just showing a blank page
thanks
sobee
Just now i went into acrobat site.
He says to change the preferences in Acrobat. By removing web browser integration.
If i do that i not getting the pdf opened in IE.
I tried this one in a machine which was already opening the page in IE
but after trying this (Changed back to prev preferences), that system too not opening the pdf now .
just showing a blank page
thanks
sobee
ASKER
Yes
Just now i went into acrobat site.
He says to change the preferences in Acrobat. By removing web browser integration.
If i do that i not getting the pdf opened in IE.
I tried this one in a machine which was already opening the page in IE
but after trying this (Changed back to prev preferences), that system too not opening the pdf now .
just showing a blank page
thanks
sobee
Just now i went into acrobat site.
He says to change the preferences in Acrobat. By removing web browser integration.
If i do that i not getting the pdf opened in IE.
I tried this one in a machine which was already opening the page in IE
but after trying this (Changed back to prev preferences), that system too not opening the pdf now .
just showing a blank page
thanks
sobee
Are you sure at least Acrobat Reader is installed on those other systems?
ASKER
Yes it is installed in all the systems
thanks
sobee
thanks
sobee
What systems, how are they connecting, what version of Acrobat, how big is the file?
If the file is big and takes a while to load, they'll see NOTHING until it's loaded (usually -- but not always, depends on the settings of the file). If you use a newer version of Acrobat and and they have an older one, the file may not load at all -- but Acrobat will be started anyway. If they didn't install the Reader correctly, or installed a new version and the plugin didn't install correctly, the Reader won't start.
They could also be getting the 'check for updates' prompt and not realize it -- that will pretty much stop everything, and the page won't load until they choose something.
If the file is big and takes a while to load, they'll see NOTHING until it's loaded (usually -- but not always, depends on the settings of the file). If you use a newer version of Acrobat and and they have an older one, the file may not load at all -- but Acrobat will be started anyway. If they didn't install the Reader correctly, or installed a new version and the plugin didn't install correctly, the Reader won't start.
They could also be getting the 'check for updates' prompt and not realize it -- that will pretty much stop everything, and the page won't load until they choose something.
ASKER
No No
Actually when a page is redirected with the particular file
in the address bar it is coming as
http://temp/a.pdf
and showing an empty page
but when i delete that http: and press enter it is loading in acrobat reader.
as i have said earlier, if change the preferences of acrobat reader then the file is getting opened in acrobat and not in IE.
more over i can't go to every system and change the preference of acrobat reader.
Actually when a page is redirected with the particular file
in the address bar it is coming as
http://temp/a.pdf
and showing an empty page
but when i delete that http: and press enter it is loading in acrobat reader.
as i have said earlier, if change the preferences of acrobat reader then the file is getting opened in acrobat and not in IE.
more over i can't go to every system and change the preference of acrobat reader.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
is TEMP the name of the web server and is a.pdf in the default web site?
Should it not be http://localhost/temp/a.pdf or are you just using TEMP instead of the correct URL?
Should it not be http://localhost/temp/a.pdf or are you just using TEMP instead of the correct URL?
ASKER
You can use this method of redirect:
Response.Write ("<meta http-equiv='refresh' content='0;URL=http://temp/a.pdf") '>")
This is a browserindepenant solution.
Hope this help.
WVDK
Response.Write ("<meta http-equiv='refresh' content='0;URL=http://temp/a.pdf") '>")
This is a browserindepenant solution.
Hope this help.
WVDK
sobee-rpg,
Try setting your PDF link up as an object:
This will open Acrobat as a helper app.
HTML>
<HEAD>
</HEAD>
<OBJECT CLASSID="clsid:CA8A9780-28 0D-11CF-A2 4D-4445535 40000"
STYLE="height:100%; width: 100%" >
<PARAM NAME="src" VALUE="http://server/path/filename.pdf">
</OBJECT>
</HTML>
Here is a link that might help:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293792
TurboDuster
Try setting your PDF link up as an object:
This will open Acrobat as a helper app.
HTML>
<HEAD>
</HEAD>
<OBJECT CLASSID="clsid:CA8A9780-28
STYLE="height:100%; width: 100%" >
<PARAM NAME="src" VALUE="http://server/path/filename.pdf">
</OBJECT>
</HTML>
Here is a link that might help:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293792
TurboDuster
<body onload="window.document.lo