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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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();
 
Get rid of the two Response.AddHeader()

R.

Tom said:
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".
 
Back
Top