File uploads and in particular multiple file uploads can be a right pain in the butt to implement. Come the reign of HTML5 (I give it till early 2011 until it really starts to take hold) I am led to believe that all our problems will be solved.

Check out the details here at the HTML5 specification.

Until that time however we have to make do with what we have. There are commercial solutions out there but if you are a tight arse like me then you want to keep it cheap (read free) and open source.

Enter uploadify http://www.uploadify.com/

However, I came across a problem yesterday related to working with IIS…

Really it’s not a problem, just a configuration entry introduced in IIS7+ that I was not aware of.

The problem I had was that files greater than 30Mb would fail. I would get either ‘Http: undefined” or the infamous ”IO Error #2038”

I had set the maximum request length to 100Mb in my web.config

<httpRuntimemaxRequestLength="100000000"/>

I had set the sizeLimit setting on uploadify to 100Mb: 'sizeLimit': 100000000, Alas, still no joy ![Sad smile](http://www.bondigeek.com/blog/wp-content/uploads/2010/09/wlEmoticonsadsmile.png) So I used Fiddler to monitor what was was going on and noticed that IIS was returning a “File or Folder not found” exception. I knew that both existed so that wasn’t the problem. So I set about debugging my script and put a break point on the error handler of the uploadify script shown below: // Add the Uploader $('#upload-target').uploadify({ 'uploader': '/Scripts/uploadify.swf', 'script': '/Scripts/Upload.ashx', 'folder': uploadFolder, 'multi': true, 'cancelImg': '/Images/cancel.png', 'fileDesc': 'All Files', 'fileExt': '*.*', 'queueSizeLimit': 999, 'sizeLimit': 100000000, 'simUploadLimit': 3, 'scriptData': { 'FolderID': selectedId, 'UserID': userId }, 'onAllComplete': function (event, data) { $("#button-refresh").click(); $('#file-upload-dialog').dialog('close'); alert("This file(s) has been uploaded"); }, 'onError': function (a, b, c, d) { if (d.status 404) alert("Could not find upload script. Use a path relative to: " + ""); elseif (d.type = "HTTP") alert("error " + d.type + ": " + d.status); elseif (d.type === "File Size") alert(c.name + " " + d.type + " Limit: " + Math.round(d.sizeLimit / 1024) + "KB"); else alert("error " + d.type + ": " + d.info); } }); Now I was getting a 404 but not a straight 404. I believe it was one of these little buggers: HTTP Substatus Description 404.13 Content Length Too Large 404.14 URL Too Long 404.15 Query String Too Long This led me to doing some Binging (yes I am saying Bing cause it is my default search engine although I use both) and on to this article [http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits](http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits) And therein was the answer my friends. A new setting ‘requestLimits ‘ since IIS7. Once I upped it to 100Mb all was good. So that is 3 places I needed to set the size limit: - Web.config – httpRuntime - Uploadify – sizeLimit - Web.config – requestLimits – Full details below <system.webServer><modulesrunAllManagedModulesForAllRequests="true"/><handlersaccessPolicy="Read, Execute, Script"/><security><requestFiltering><requestLimitsmaxAllowedContentLength="100000000"/>requestFiltering>security>system.webServer> Hope that helps someone out there who has the same issue. BondiGeek