views:

134

answers:

2

What are, nowadays, the best practices for uploading a large file (which may cause a timeout) with ASP.NET Web Forms and/or MVC?

+2  A: 

The very best way that I have found for uploading large files is Darren Johnstone's File Upload Control.

It includes a progress bar, doesn't require flash, and gracefully handles the memory problems that can occur when uploading files through IIS.

It even contains a module for uploading files directly to SQL Server.

Robert Harvey
I've used this before and after a bit of fiddling it worked fairly well and only had one bug relating to IIS7 web.config settings (it doesn't pick them up). However it doesn't appear to be actively developed anymore, which is ashame.
Castrohenge
@Kieranmaine: Which means that it's already perfect! I find it odd that so many developers dismiss a piece of software because the last check-in was three months ago.
Robert Harvey
I wouldn't say don't use it, just be aware you'll need to invest time for bug fixes or changes.
Castrohenge
@Robert: thank you for showing me the memory issue, I didn't know it. :) It's a pity my team chose the dumbest solution (increasing the server's timeout... with our slow Italian ADSLs, "large" files means 2 MB images...), I've lost the opportunity to learn something new about client-side image resizing, chunking, etc...
Notoriousxl
A: 

Every mayor component suite probably has an upload control. So if you already use such a component suite you can use one of those.

Make sure that whatever you use as an upload tool that it streams to IIS, and doesn't first upload it all to memory before writing it.

Mischa Kroon