How do I restrict the upload filesize in vb.net? -


is there better way ?

if fileupload1.postedfile.contentlength > 500000     label1.forecolor = system.drawing.color.red     label1.text = "please enter filesize less 500kb!" end if 

i think iis 7 uses maxallowedcontentlength specifying file upload size (kb). edit web.config so:

<system.web>     <httpruntime maxrequestlength="2097152" /> </system.web> <system.webserver>     <security>         <requestfiltering>             <requestlimits maxallowedcontentlength="2147483648" />         </requestfiltering>     </security> </system.webserver> 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -