开发者

How to check the size of a file before that the server receive it?

I have a issue on uploading files:

In order to avoid an overloading of the server, I would check the size of a file before开发者_开发知识库 that the server receives it. If I am not wrong, pressing the submit button of a form which contains a file input field (<input type="file" name="...">), the server first will entirely receive the file and after will check the file.


I'm guessing that file uploads will have a Content-Length header, in which case, you can just check that at the server end and drop the connection if it's too large.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜