My way to protect uploaded files in FILE SYSTEM.
IN ASP.NET,
Files with extensions "*.config" are protectd well by the dotnet frameword.
According this ,
you can protect your files with some little/smart changes:
just change the extension of the uploaded files to "*.config".
For example: "test.doc" --> "test.doc.config".
All the modifications are listed as follows:
//=========================================
//1st modification
//In resource.ashx.cs,
//modification are made against the function "GetResponseAttachment"
....
string fileName = context.Server.MapPath( String.Format( "{0}{1}.{2}.{3}", sUpDir, row ["MessageID"], row ["FileName"], ".config" ) );
//Just append ".config" to the original fileName.
//=========================================
//=========================================
//2nd modification
//In attachments.ascx.cs,
//modification are made against the function "SaveAttachment"
...
file.PostedFile.SaveAs( String.Format( "{0}{1}.{2}.{3}", sUpDir, messageID, filename, "config"

);
//Just append ".config" to the original fileName to get the right file.