You need to reject files larger than 1 MB

You are implementing a Web page that allows users to upload files to a Web server. The page
includes a form that has a Submit button. You need to reject files larger than 1 MB. What should you
do?

You are implementing a Web page that allows users to upload files to a Web server. The page
includes a form that has a Submit button. You need to reject files larger than 1 MB. What should you
do?

A.
Add an HTML input type= file control. Add an onSubmit handler to the form to check the file size
and cancel the form submission if the file size is too large.

B.
Add an HTML input type= file control. Add an onChange handler to the input control to check the
file size and cancel the upload if the file size is too large.

C.
Add an ASP.NET FileUpload control and configure it to run on the server. Add a server-side OnClick
handler to the form’s Submit button to save the file only if the file size is allowed.

D.
Add an ASP.NET FileUpload control and configure it to run on the server. Add a server-side
OnDataBinding handler that saves the file only if the file size is allowed.



Leave a Reply 0

Your email address will not be published. Required fields are marked *