Uploadify your large files in .NET

With the increase in memory for servers and the subsequent decrease in price, you’d have thought .net would have had a better way to upload files of a larger persuasion built in.  Nope!

So when I found Uploadify I thought, ooh that’s nice!  And I have to thank William Duffy (again!!) for this find.  It gives you a real nice uploading widget thing without the dreaded postback.  As it uses Adobe Flash to achieve this, it means you can concentrate on other things, like the CSS.  It’s also VERY lightweight, only 30kb for the min’d javascript and the swf file.  Well done lads.

But while I was using it, I was trying to upload a large file – 200MB, which these days isn’t really that large now is it?  And I was doing this on localhost so I never thought about file size limits.  But I hit it although I already knew what to do:

<httpRuntime requestValidationMode="2.0" maxRequestLength="1024000" />

So I quickly popped that into my web.config file. ERROR!  This new error I was getting said “404” which was a bit strange.  For some reason the file was not hitting the server.  Uploadify was initially light on the ground when it came to explaining .NET issues as their programmers were PHP, and the .NET implementation they show doesn’t talk about my issue.  It took searching in Google to find an obscure post in Uploadify’s forum.  So well done lads, but better put that right at the top of the to do list when implementing it in .NET.

So here is a part of my web.config file to get Uploadify to work with large files:

<httpRuntime requestValidationMode="2.0" maxRequestLength="1024000" />
	</system.web>
	<system.webServer>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="2000000000"></requestLimits>
            </requestFiltering>
        </security>

Hope that helps someone too!

2 thoughts on “Uploadify your large files in .NET”

  1. Yes, thanks for this! I changed the httpRuntime maxRequestLength to 2097151 but I wasn’t aware that I also needed to change the maxAllowedContentLength in the requestLimits

Leave a Reply

Your email address will not be published.