Home > Article > Web Front-end > JS limits uploaded image size locally without using controls_Basic knowledge
The detection before file upload is usually based on the file name to determine whether the file type is legal, but it is difficult to detect the size of the file unless it is done locally or using controls. The word problem can be easily solved using JS. JS can determine the size before uploading the image. This can be achieved with javascript. The effect...//The size of the image file allowed to be uploaded
The specific code is as follows