[thelist] .NET: Uploading & downloading large documents

Casey Crookston caseyc at IntelliSoftmn.com
Fri Jan 12 17:13:10 CST 2007


I'm having a little trouble writing a module to upload and download
files to the server - a small doc management tool, if you will.  

 

First of all, when the file size approaches 7 or 8 MB, it will time out.
I think it is fair to cap the file size at 10MB, but is there a way to
bump up the time out value?  Would this be an IIS setting?

 

Second, when downloading the file, we do not want the browser to attempt
to open the file within the browser.  We simply want it to open a dialog
box and allow the user to select a location to save.  I did some hunting
around and found a script to do that ( see below) but, the oddest thing,
every file it downloads ends up being 0 kb in size.  They upload
correctly, but after being downloaded they are empty.

 

Here's the script:

 

 

                                    Dim filepath As String =
Request.Params("file")

                                    If Not filepath Is Nothing Then

                                                Dim filename As String =
Path.GetFileName(filepath)

                                                Response.Clear()

                                                Response.ContentType =
"application/octet-stream"

 
Response.AddHeader("Content-Disposition", "attachment; filename=""" &
filename & """")

                                                Response.Flush()

 
Response.WriteFile(filepath)                                         

                                    End If

 

Any help would be greatly appreciated!

 

Casey




More information about the thelist mailing list