I have written a custom http handler. I have done this by writing a class which implements the IHttphandler.
Inside that class I have code like this,
try to set up the max size file on the web config to a bigger one.
You can set the maxRequestLength (in kb)
try to not reclycle app pools on iis to often also.