Download Large File

Discussion in 'ASP .Net' started by =?Utf-8?B?Slppbms=?=, Feb 26, 2004.

  1. 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
    =?Utf-8?B?Slppbms=?=, Feb 26, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?Slppbms=?=

    Lucas Tam Guest

    "=?Utf-8?B?Slppbms=?=" <> wrote in
    news::

    > 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?



    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
    Lucas Tam, Feb 26, 2004
    #2
    1. Advertising

  3. Do you have any sample code ?
    =?Utf-8?B?Slppbms=?=, Feb 26, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Adam Smith
    Replies:
    1
    Views:
    311
    Adam Smith
    Apr 21, 2004
  2. Ryan Taylor
    Replies:
    2
    Views:
    946
    Ryan Taylor
    Nov 10, 2004
  3. Sam --
    Replies:
    2
    Views:
    608
    Sam --
    Mar 17, 2005
  4. Brett  Kelly
    Replies:
    1
    Views:
    680
    Steve C. Orr [MVP, MCSD]
    Jun 16, 2006
  5. Replies:
    5
    Views:
    875
    Xho Jingleheimerschmidt
    Apr 2, 2009
Loading...

Share This Page