473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

PDF files launch in notepade???

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
1 1352
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Keith Brown | last post by:
I have an application that allows embedded storage of ANY chosen file in an OLE field. The file could have been dragged-and-dropped into the field or it might have been selected and imported...
7
by: Chuck Bowling | last post by:
I'm doing something wrong... not quite sure what... I got a basic web forms page built and running inside the IDE per ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/vbcon/html/vbwlkWalkthroughCr...
2
by: Cy Huckaba | last post by:
I am writing a program that will search xml files for some of our dev team here and list the files in a list box. I would like to be able to double-click on the file name and have the file open...
5
by: cooltoriz | last post by:
Hello there, I am not asking how to impersonate a process within C# windows application. I already know that, in C# v2.0, you can easily achieve it using ProcessStartInfo. You can run a process...
1
by: Kesavan | last post by:
I install apache2 in /usr/local/apache2 and install php5 by ./configure --with-apxs2=/usr/local/apache2/bin/ apxs PHP is successfully installed in my system. But now my .php files inside...
6
by: henryrhenryr | last post by:
I have tried posting in PHP forum but no reply. I think it's not a problem with PHP anyway so perhaps someone in this forum can help. When I use the code below to try and launch notepad.exe from...
8
by: =?Utf-8?B?Umlja0Q=?= | last post by:
Suddenly I find myself unable to open Winforms files in designer mode. I get the message quoted below. I can open other types of vb files like modules, classes and code behind files, but simply...
4
by: Karl | last post by:
Hi all, I want to write an application that is launched from the context menu in Windows Explorer/Computer. That is to say, when I am browsing around my hard drive and get to any location I...
4
by: Stef Mientki | last post by:
Hello, I've 2 questions about python help files: 1. how can I launch the windows help file (CHM), from python with a keyword as argument ? 2. now when my program should also run under...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.