Weichung,
thanks for your post, but your code is virtually the same as mine. The
problem is that the Response that you use to send the file
(Response.Write()) is blocked while the file is sent to the client.
Right after the last byte is written to the client, the next line in
your code (Response.End()) is called. My problem is that I want to
continue browsing during a long download (>100 MB). In your case, the
Response is blocked until the file is sent, meaning that no further
request can be made from the same client until the download is
finished. I considered the possibility of creating another ASP.NET
application which is only responsible for sending the file. But is
that the common way?
weichung <we*************@mail.codecomments.com> wrote in message news:<we*************@mail.codecomments.com>...
hoenes1 wrote: *Hi,
in my ASP.NET App, I have a list of files which the user can
download
on click (using Response.BinaryWrite()). the problem is, that once a
download has started, the user can't navigate in the window because
the response is sending the file and so no new requests can be made.
what possibilities do i have to make the client able to browse other
pages in my app while downloading a file?
Thanks in advance. *
I saw this piece of code, using the Response.Write in the same page,
and did not experience any problem, hope that it could help you.
where strPath is the path of the file you want to allow the user to
download.
Dim path As String = Server.MapPath(strPath)
Dim file As IO.FileInfo = New IO.FileInfo(path)
If file.Exists Then
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment;filename=" &
file.Name)
Response.AddHeader("Content-Length", file.Length.ToString())
Response.ContentType = "application/octet-stream"
Response.WriteFile(file.FullName)
Response.End()
End If