PDF files launch in notepade???

G

Guest

Can someone please tell me why when ever I view a PDF file through my web
application the file opens in notepad...

I have checked my file association and the client machine is set to launch
PDF's in Acrobat Reader 7 so that isn't the problem...

Here is the part of the code for my view.aspx file... which works fine with
word an excel documents but for some reason won't open PDF's...

Thanks


...CODE..
While myReader.Read
Response.BinaryWrite(myReader.Item("Data")) 'Writing the
File retrieved from the database
Response.ContentType = myReader.Item("fileType") 'Setting
the file type of the retrieved file
End While
 
G

Guest

G'day Tim.

I would check what that Response.ContentType is getting set to. Should
probably be "application/octet-stream"

Also are you doing:

response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);

or something similar?

Hth,

Cheers,

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top