Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Error When Redirecting to a PDF file

Reply
Thread Tools

Error When Redirecting to a PDF file

 
 
mansb2002@yahoo.com
Guest
Posts: n/a
 
      06-11-2007
> Response.Redirect("/website/pdffiles/myreport.pdf");

> That does not appear to be required, based on your further description of
> the issue. When you asserted that you were redirecting to a .pdf file, you
> implied that myreport.pdf was actually an ASP script. So, either you are
> already set up to parse .pdf that way, or you are not redirecting to a
> resource called myreport.pdf.


"myreport.pdf" is actual PDF file NOT an ASP page.


 
Reply With Quote
 
 
 
 
Dave Anderson
Guest
Posts: n/a
 
      06-11-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> "myreport.pdf" is actual PDF file NOT an ASP page.


There is a huge inconsistency in your description of the problem. If you
are, in fact, redirecting directly to the PDF file, then your ASP script is
irrelevant. So which is it, an ASP script that reads a PDF document and uses
BinaryWrite(), or a PDF document that is sent directly?



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.


 
Reply With Quote
 
 
 
 
mansb2002@yahoo.com
Guest
Posts: n/a
 
      06-12-2007
First I would like to apologize for the confusion. Originally, I was
using:

Response.Redirect("/website/pdffiles/myreport.pdf");

To direct the user to the PDF file. Every thing was working ok until I
switched to Win2003 server. At that time the above command no longer
worked. So, I tried the second method which was to read in the PDF
file. This is what I have:

Original.ASP file:
Some code....
....
....
Response.Redirect("/website/html/showpdf.asp");
Response.End;


ShowPDF.ASP file:

<html>
<body>
<% @ LANGUAGE="JScript" CODEPAGE="932" %>
<%
Response.Buffer = true;
Response.Expires = 0;
pdfFile = "myreport.pdf";
Response.Clear;
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "inline;filename=" +
pdfFile);
var oPDF = oProcess.FileToStr(pdfFile);
Response.BinaryWrite(oPDF);
Response.End;
%>
</body>
</html>

I hope this will clear some confusion. Again I apologize for getting
all the things mixed up. Thanks for your help.

 
Reply With Quote
 
Dave Anderson
Guest
Posts: n/a
 
      06-12-2007
(E-Mail Removed) wrote:
> First I would like to apologize for the confusion. Originally,
> I was using:
>
> Response.Redirect("/website/pdffiles/myreport.pdf");
>
> To direct the user to the PDF file. Every thing was working ok
> until I switched to Win2003 server. At that time the above command
> no longer worked.


OK. In that case, you can probably just revert to the old redirection to the
PDF file if you enable PDF in IIS6. Open the properties for your web site
and click on the HTTP Headers tab. Click on the [MIME Types...] button, and
add the PDF extension with MIME type "application/pdf".

If this does not work, and you need to resume the ASP approach, let me know
in this thread.




--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.


 
Reply With Quote
 
mansb2002@yahoo.com
Guest
Posts: n/a
 
      06-15-2007
On Jun 12, 4:19 pm, "Dave Anderson" <(E-Mail Removed)>
wrote:
> (E-Mail Removed) wrote:
> > First I would like to apologize for the confusion. Originally,
> > I was using:

>
> > Response.Redirect("/website/pdffiles/myreport.pdf");

>
> > To direct the user to the PDF file. Every thing was working ok
> > until I switched to Win2003 server. At that time the above command
> > no longer worked.

>
> OK. In that case, you can probably just revert to the old redirection to the
> PDF file if you enable PDF in IIS6. Open the properties for your web site
> and click on the HTTP Headers tab. Click on the [MIME Types...] button, and
> add the PDF extension with MIME type "application/pdf".
>
> If this does not work, and you need to resume the ASP approach, let me know
> in this thread.
>
> --
> Dave Anderson


Sorry, I was away.

I just tried your suggestion and guess what? No change. I still get
the same error. IE opens a "File Download" box and if you click the
"open" button then nothing happens. If you click the "Save" button the
following error comes up:

"Internet Explorer cannot download "myreport.pdf" from "website".
Internet Explorer was not able to open this Internet site. The
requested site is either unavailable or cannot be found. Please try
again later."
Any other ideas

 
Reply With Quote
 
mansb2002@yahoo.com
Guest
Posts: n/a
 
      06-18-2007
On Jun 16, 11:00 am, "Dave Anderson" <(E-Mail Removed)>
wrote:
> <(E-Mail Removed)> wrote:
> > I just tried your suggestion and guess what? No change.

>
> Which change? You are now pointing the browser directly to PDF file?
>
> > I still get the same error. IE opens a "File Download" box and if
> > you click the "open" button then nothing happens. If you click the
> > "Save" button the following error comes up:

>
> > "Internet Explorer cannot download "myreport.pdf" from "website".
> > Internet Explorer was not able to open this Internet site. The
> > requested site is either unavailable or cannot be found. Please
> > try again later."

>
> I would have long ago tested this with Firefox and the LiveHTTPHeaders
> extension. You should, too. That way, you can show the response headers
> instead of the dumbed down consumer-grade message IE provides.
>
> --
> Dave Anderson
>
> Unsolicited commercial email will be read at a cost of $500 per message. Use
> of this email address implies consent to these terms.


Hi Dave,

FireFox has no problem showing the PDF file. Most of our users only
use IE.

 
Reply With Quote
 
Dave Anderson
Guest
Posts: n/a
 
      06-18-2007
(E-Mail Removed) wrote:
>> I would have long ago tested this with Firefox and the
>> LiveHTTPHeaders extension. You should, too. That way, you
>> can show the response headers instead of the dumbed down
>> consumer-grade message IE provides.

>
> FireFox has no problem showing the PDF file. Most of our
> users only use IE.


While that's good information, it ignores the salient point, which is that
you can use the LiveHTTPHeaders extension to view the response headers.
Since you do not have this problem with IIS5, but do have the problem with
IIS6, I suggest you compare the headers. The headers direct disposition
(browser behavior), after all.




--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Postscript to PDF with pdf-tools, pdf-writer, or other Sean Nakasone Ruby 1 04-14-2008 09:13 PM
PDF::Writer, create pdf and insert in other pdf file. Ricardo Pog Ruby 1 03-26-2008 08:24 PM
Open linked PDF-Files from a PDF-File Paul Kuebler ASP .Net 8 08-18-2003 04:42 PM
Re: Open linked PDF-Files from a PDF-File Carl Prothman [MVP] ASP .Net 4 08-12-2003 09:26 AM
Problem redirecting to specific PDF page in an iframe using ASP.NET Leslie McGann ASP .Net 0 07-03-2003 03:42 PM



Advertisments