HTML Upload MAX_FILE_SIZE does not appear to work

后端 未结 7 2284
星月不相逢
星月不相逢 2020-11-29 02:46

I am wondering how is the hidden field named MAX_FILE_SIZE supposed to work?

7条回答
  •  没有蜡笔的小新
    2020-11-29 03:21

    PHP.net explanation about MAX_FILE_SIZE hidden field.

    The MAX_FILE_SIZE hidden field (measured in bytes) must precede the file input field, and its value is the maximum filesize accepted by PHP. This form element should always be used as it saves users the trouble of waiting for a big file being transferred only to find that it was too large and the transfer failed. Keep in mind: fooling this setting on the browser side is quite easy, so never rely on files with a greater size being blocked by this feature. It is merely a convenience feature for users on the client side of the application. The PHP settings (on the server side) for maximum-size, however, cannot be fooled.

    http://php.net/manual/en/features.file-upload.post-method.php

提交回复
热议问题