opening a .TXT file

G

Guest

Hi All,

I am using the below code to open a .TXT file.
I am getting a dialog box to open/save the file.
I am able to save the file properly.
But when i select OPEN option to open file directly, the get the ERROR msg
saying "cannot find C:\documents and settings\Temproary Internet
Files\...\Filename.TXT. Do you want to create a new file ??"

How to resolve this problem, am i misssing any setting ??


Response.Buffer = true
Response.clear

'Response.ContentType = "application/octect-stream"
Response.AddHeader "Content-Length", bytesprocessed
Response.AddHeader "content-disposition", "attachment; filename=" &
filename
'Response.AddHeader "content-disposition", "attachment;
filename=MACKCAN200410.doc"
Response.ContentType = "text/plain"
Response.binarywrite leftb(cstr(outstream), bytesprocessed)
Response.flush
Response.end

Thanks
--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
---_,>/'_------
(_) \(_)
---------------
 
S

Steve C. Orr [MVP, MCSD]

I think you're confusing it by telling it that the document is a text file,
and then also telling it that it's a DOC file.
Make up your mind. These file types are handled differently.

Try this:
Response.ContentType = "application/ms-word"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top