How does input type=file do the local loading effect? What events can be used?

upload files locally using input type= "file", usually write

<form>
     <input type="file"  onChange={this.handleFileChange.bind(this)}/>
     <input type="reset" ref={(input) => this.reset=input} className="reset" />
</form>
The event taken by

is onChange, and the parameter e, e.target.files [0] can get the file, if the file is large! Which events can be used to display the loading status, such as what events will happen when I select the file and what events will happen when the file comes back? I"ve been looking for this for a long time, but I can"t find any information! So let me ask you something.

Mar.23,2021

https://developer.mozilla.org. look at the document first and think about what you want to achieve by loading file before searching for related questions


onChange refers to the file input change, that is, the user selected the file. Load file I don't know if you're asking if you want to load a picture or upload a file? If you are loading a local image, please refer to https://www.cnblogs.com/moqiu.
. If you are uploading a picture, please refer to this: https://blog.csdn.net/it_fy_/.
.. For the operation of input file, to sum up, you probably listen to onChange, and then use the: FileReader.readAsXXXX method in the event handler to read the load file.


the onChange event will be triggered after the file is selected, which has nothing to do with the size of the file. I don't know what effect you want.


FileReader may help you

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e9ab-2b78d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e9ab-2b78d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?