I’m creating a small Silverlight uploader. It does 2 things: checks the file size and type and uploads the file. I’m creating an http handler on the receiving end. However, the Silverlight code can still be manipulated or bypassed and I don’t want to tie up the server because someone’s uploading 100MB file. How do I restrict the size of the upload in the http handler so that if the size of the file partially uploaded already exceeds 3MB then stop the upload.
Thanks for your suggestions.
Set the max request length to be 3MB on your web.config
Documentation here.