473,480 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

There was an erro opening this document. The file cannot be found

Tom
Anytime someone wants to open a document, they have to first save it to disk. They cannot simply choose "open". If a user attempts to open the document, they are met with the error message "there was an error opening the document the file cannot be found".

Here is my C# ASP.NET web code. I am running IE 6.0.

Can anyone advise.

... First I create the file and then use Response object to open it.
Response.ContentType="application/pdf";
Response.AddHeader("Content-Disposition", "attachment;filename=Filename.pdf");
Response.AddHeader("Content-Length",bDoc.Length.ToString());
Response.BinaryWrite(bDoc);
Response.End();

Nov 15 '05 #1
2 8213
Get rid of the two Response.AddHeader()

R.

"Tom" <an*******@discussions.microsoft.com> wrote in message
news:9F**********************************@microsof t.com...
Anytime someone wants to open a document, they have to first save it to disk. They cannot simply choose "open". If a user attempts to open the
document, they are met with the error message "there was an error opening
the document the file cannot be found".
Here is my C# ASP.NET web code. I am running IE 6.0.

Can anyone advise.

... First I create the file and then use Response object to open it.
Response.ContentType="application/pdf";
Response.AddHeader("Content-Disposition", "attachment;filename=Filename.pdf"); Response.AddHeader("Content-Length",bDoc.Length.ToString());
Response.BinaryWrite(bDoc);
Response.End();

Nov 15 '05 #2
Tom
Can you suggest what I should use in place of Response.AddHeader()?
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2741
by: V Bradley | last post by:
Hi there, I am a newbie working from the Visual Basic Programmers Workbook. I have created a text file called Origin.txt but when I go to open it I keep getting a "file does not exist" error,...
4
5127
by: Brian K. | last post by:
I am trying to split up and secure a database that we've been using on a network for a few years, following the procedure listed in Q304932 from microsoft. I create a new blank database for...
1
4700
by: code_wrong | last post by:
Hi, I'm reading this: http://www.catch22.net/tuts/selfdel.asp (Self Deleting Executables) and playing around with the batch file method .. trouble is I always get a command box at the end with...
8
2122
by: Claudio Grondi | last post by:
Here an example of what I mean (Python 2.4.2, IDLE 1.1.2, Windows XP SP2, NTFS file system, 80 GByte large file): Traceback (most recent call last): File "<pyshell#1>", line 1, in -toplevel-...
4
1207
by: NullQwerty | last post by:
I've got some strange activity occuring. We have a development server which mirrors our production server. I have an Active-X .Net dll that sits in a Web Site Folder and is used by an aspx...
5
3509
by: =?Utf-8?B?Um9u?= | last post by:
I am writing out some files, using this syntax: FileStream fw = File.OpenWrite(Filename); fw.Write(bytearray,0,amount); fw.Close(); The files appear in Windows Explorer, they show up from the...
3
6764
by: blerina | last post by:
hi, i have a simple asp code that opens an excel file. it works fine with simple excel files that don't contain formula. i think the problem is that my excel file contains formulas and...
1
1805
by: Sanjeeva K kanakam | last post by:
Hi all, I am developing one application. In that i have created on report file which contains tables, titles and tree view list also by using HTML tags. I am opening this file in my application it...
9
3112
by: Jerry West | last post by:
I installed VB6 onto a Vista system to check some legacy code. When I run my project, the code where shell folders are determined, I get the following error when using the API:SHGetFolderPath ...
0
7037
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
6904
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
7076
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6730
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
6873
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...
1
4767
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.