Recommended way to check file size on upload

前端 未结 10 881
南笙
南笙 2021-02-04 10:33

I am working on a web application which supports file uploading. I am already familiar checking the size in server side, but i wanted to check the file size in a client side.

10条回答
  •  萌比男神i
    2021-02-04 11:13

    After lot of searching i found we can use maxAllowedContentLength to limit the upload size in ASP.Net applications. Remember this settings work only on IIS 7 or above.

    Since this is handled in IIS level, we dont need to handle anything in server code. If the size limit exceeds, it will return the error code 404.13. So you can easily check the code in client side to determine the problem.

    This is what i have done to handle the large files if the flash is not installed in the client machine.

    Hope this may help someone.

    For more info read about this settings, read this

提交回复
热议问题