views:

324

answers:

3

Is there any limit theoretically on the size of file that can be uploaded by a client using the browser's file upload using HTML form?

I am posing this because Flash has a drawback where the largest file size you can upload is lesser than the size of available RAM. I am wondering if there is any such restrictions with the browsers...

+3  A: 

If your file upload is larger than 2Gb you will run into problems with HTTP uploads.

The "available RAM" limit suggests that the file data is being sucked all into memory, which is very inefficient especially when the file size grows. Streams are much more efficient for this.

BranTheMan
+2  A: 

I suppose it would depend on the server receiving the request, both settings and the way the receive is implemented. Apache probably has a different implementation of the receive end from IIS. On the client side the file is read from disk (again this would depend on the browser the client is using and how that is implemented) so there shouldn't be. I don't know if this is ever mentioned say in IE's documentation.

Matti
+1  A: 

BranTheMan is correct, I hit this issues a few years ago and we decompiled bits of ASP.NET and found that it will take the file and put it in a byte array. So you cannot get around this.

Maybe with 64 bit hardware you can push past the 2GB limit, but.. 2GB is quite a lot anyways so maybe its enough.

The problem you may run into is if lots of people upload large files. eg 100 people upload 20 meg files as the process cannot allocate more than 2GB on a standard 32 bit server. (with no config changes)

Steve