By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,389 Members | 2,065 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,389 IT Pros & Developers. It's quick & easy.

PDF files launch in notepade???

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

"Tim::.." wrote:
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

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.