Download Large File

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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?
 
Back
Top