views:

931

answers:

2

update - if I remove the runat="server" this does not happen...then how do I get the value of the dialog back to the code behind

Scenario goes like this. I have this code on my page

<input type="file" id="ID" runat="server" /> <asp:Button ID="btn" runat="server" Text="click me you chump" />

when I browse to a large file (200mb) and then click the button...mind you, there is nothing going on when you click other than a postback, I have a Connection Interrupted error in my browser. If I do this with smaller files, it's not an issue...the only problem is, I need to be able to get the location of the database to make a connection string.

I need to allow the user to browse to the directory, select the database, hit the button and prepare a connection string.

At the very least if someone could try this real quick and let me know if this happens to you also.

Thank Jim

+1  A: 

Did you try to increase the file upload limit in the web.config :

http://www.codeproject.com/KB/aspnet/uploadlargefilesaspnet.aspx

Olivier PAYEN
+1  A: 

Check out: This Article From MS

Particularly (emphasis mine):

MORE INFORMATION

Theoretically, the maximum file upload size is fairly large. However, because of ASP.NET health monitoring, you cannot upload very large files in ASP.NET. The ASP.NET worker process has a virtual address space of 2 gigabytes (GB). However, the ASP.NET worker process only uses a little more than 1 GB because of health monitoring and memory fragmentation.

During the upload process, ASP.NET loads the whole file in memory before the user can save the file to the disk. Therefore, the process may recycle because of the memoryLimit attribute of the processModel tag in the Machine.config file. The memoryLimit attribute specifies the percentage of physical memory that the ASP.NET worker process can exhaust before the process is automatically recycled. Recycling prevents memory leaks from causing ASP.NET to crash or to stop responding.

Additionally, other factors play a role in the maximum file size that can be uploaded. These factors include available memory, available hard disk space, processor speed, and current network traffic. With regular traffic of files being uploaded, Microsoft recommends that you use a maximum file size in the range of 10 to 20 megabytes (MB). If you rarely upload files, the maximum file size may be 100 MB.

Note You can upload files that are larger than 100 MB in ASP.NET. However, Microsoft recommends that you follow the maximum file upload sizes that are mentioned in this article. To determine more precise file sizes, perform stress testing on computers that are similar to the ones that will be used in production.

While not addresing your specific problem This Article from Jon Galloway could be of some help to you.

Jon P
interesting....I'm not actually uploading anything, but I still have to set this limit 1 gig to deal with the large files. Thanks for the help.
jim
I don't actually want to upload anything, I just need the file path to the mdb...is there another solution?
jim