Download Large File

G

Guest

I am using the following code to allow the ability to open a large text file on our web server

Response.ContentType = "application/x-msdownload"
Response.AppendHeader("content-disposition", "attachment; filename=reportenginelog.txt")
string FilePath = @"c:\tqis\logs\reportenginelog.txt";
Response.WriteFile(FilePath)
Response.End()

The problem I am running into is that there is a windows service running on the web server that updates the file. when I execute the code above I get a "file in use" error. Is there a better way to accomplish this task that will get me past this problem ?
If I log onto the server I can open the file in notepad even when the windows service is running
 
L

Lucas Tam

Is there a better way to accomplish this task that will get me past
this problem ?

How about opening the file with a FileStream (in read mode)... read it into
an array, and write the file back out?
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top