473,770 Members | 7,213 Online
Bytes | Software Development & Data Engineering Community
+ 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.Conten tType="applicat ion/pdf";
Response.AddHea der("Content-Disposition", "attachment;fil ename=Filename. pdf");
Response.AddHea der("Content-Length",bDoc.Le ngth.ToString() );
Response.Binary Write(bDoc);
Response.End();

Nov 15 '05 #1
2 8225
Get rid of the two Response.AddHea der()

R.

"Tom" <an*******@disc ussions.microso ft.com> wrote in message
news:9F******** *************** ***********@mic rosoft.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.Conten tType="applicat ion/pdf";
Response.AddHea der("Content-Disposition", "attachment;fil ename=Filename. pdf"); Response.AddHea der("Content-Length",bDoc.Le ngth.ToString() );
Response.Binary Write(bDoc);
Response.End();

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

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

Similar topics

1
2753
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, although it definitely does. Any ideas? Here is code: Private Sub cmdInputFile_Click() Dim intYear As Integer
4
5156
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 the front end, and am able to import tables and link from the backend. Queries come in ok too. When I tried to import Modules, forms, and reports, most of them failed with the error: "File Not Found:...
1
4733
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 the "the batch file cannot be found" message .. how can I get rid of this .. while staying with the batch file method? here is my code: /*self deleting exe*/
8
2131
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- f = file('veryBigFile.dat','r+') IOError: No such file or directory: 'veryBigFile.dat'
4
1219
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 page. All of the sudden the ActiveX component stopped working on the development server but still works on production. I checked the logs, and it was saying File Cannot Be Found when trying to find the .dll, but it is there. It does however work,...
5
3531
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 DOS Cmd when I do a wild card dir, but they cannot be copied in the DOS Cmd box. I get "file not found". Am I missing a step; not doing something? This is .NET 1.1.
3
6803
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 calculations. when opening this file with vb 6.0 code it works fine. here is a the simple code: Dim xlObject, xlBook,wks
1
1830
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 self as another window. There is no problem in opening this file if the file is small. If the file is big(here i mean to say if number of tables present in this file)then while opening this file my application is displaying a message "Cannot create...
9
3129
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 Error #48: File Not Found I checked and shfolder is definitely in the sytem32 folder. But of course, the legacy code is expecting the pre-Vista version of shfolder.dll. Has there been so much change in this file that it would return a file not...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10230
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10058
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9870
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8886
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6678
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3576
muto222
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.