I used to use version 2.1.4. After seeing the update, I tried it and found that there were many changes.
First, introduce js and css
Next is the code:
Where onUploadSuccess is the callback function after successful upload file is the uploaded file. You can get the file name size through file.name to get the size
data is the string output by the background reponse. In the above example, the output is a json object, so eval is used for conversion
response is the result true or false. Please refer to official documents for details.
You can see that many properties in the initialization have changed, including the function name of the upload operation and so on.
Secondly, there is another problem. The button of uploading the file in IE9 can't be clicked. The initial check may be caused by the problem of flash. Baidu later found that the classid in the source js can be modified.
For details, please refer to:
js replacement file download after solving this problem