Making 'file' input element mandatory (required)

后端 未结 8 654
忘掉有多难
忘掉有多难 2020-12-31 00:11

I want to make (an HTML) \'file\' input element mandatory: something like


But it i

8条回答
  •  醉话见心
    2020-12-31 00:17

    All statements above are entirely correct. However, it is possible for a malicious user to send a POST request without using your form in order to generate errors. Thus, HTML and JS, while offering a user-friendly approach, will not prevent these sorts of attacks. To do so, make sure that your server double checks request data to make sure nothing is empty.

提交回复
热议问题