File Upload of more than 4GB

2020-08-25 06:07发布

问题:

I wish to create an ASP.NET web application that allows upload of files up to a size of 4GB. How can I achieve that? I would prefer something like a "Download" manager where I can resume, pause etc...

Is that possible? If so, where should I start? I think asp.net has a limit of 4mb upload or something? I am not too sure..

Please advice.

Cheers

回答1:

You can do files up to 4GB with ASP.NET using a third party solution that overrides the built-in request checking. This will work in all versions of IIS except IIS 7 integrated mode, which has a hard 2GB limit.

Most uploaders don't have the capacity for pause/resume, so you may be out of luck there. Google and see what you can find. You'll probably have to go Java or ActiveX to get this functionality.

begin plug

I'm the author of SlickUpload, one of the first ASP.NET uploaders -- it supports uploads up to 4 GB. We don't have Flash, Silverlight, or Java support, but currently do have the best AJAX only experience, and the rich applet interfaces are coming in future versions.



回答2:

You'll probably want to use a third-party component to do this.

You're correct in that by default, the standard file upload control won't allow anything beyond 4MB. You can change that value using the maxRequestLength attribute of the httpRuntime configuration section in web.config. You'd also need to change the executionTimeout attribute. See here for more info.

But up to 4GB? I doubt you'll have much success with a standard file upload control. If the connection drops, it's all over and they'll have to start again. You probably want something that can maintain the connection and provide a progress bar and the like.

Have a look at products like FileUp or EasyAlgo. A google search should find you plenty.



回答3:

You can always implement file uploads yourself, it's really not that super difficult if the .NET utility has some limit coded in to it (though it really shouldn't).

As far as some kind of "upload" manager that you can resume, etc, that's simply not possible as it requires cooperation with with the client, and the modern browsers upload functionality simply isn't that "smart".

You might be able to create a small Java Applet that you can embed in your page to handle the client side of the conversation, but you'll need to sign the applet, and you'll also need custom server logic to handle the backend.



回答4:

In addition to the server's limits, browsers also limit the size of a file that can be sent in a POST (slightly outdated: http://www.motobit.com/help/scptutl/pa98.htm). This is why many implement a Flash- or Java-based solution that can perform the upload "out-of-band" using a direct pipe to the server, so to speak.



回答5:

The limit in .NET 2.0 is 2 GB.

If 3.5, then consider this in your web.config, if you have one. it sets the max file size and timeout :

<httpRuntime maxRequestLength="4194304" executionTimeout="2400"/>

Of course, uploading file to a web site can be dangerous if you are not caustious, so like the other posters, consider using an existing tested one, at least to learn all the caveats. Good luck.



回答6:

The file upload limit is usually governed by a server configuration file. I'm sorry, i'm a PHP guy so I'm not certain in asp.net but for our server we have a php.ini file with the upload_max_filesize that sets the total size allowable.

For the upload manager, you'll likely need something built using java net beans, a java-based plugin you can purchase or swfuploader.

We've used swfuploader with much success on many sites.



回答7:

at filemail.com they have used a Flex-client even though the site is based on asp.net. So overall i think "everyone" use a active-x kind of client for this task.