Home >Web Front-end >H5 Tutorial >Problems and solutions encountered in implementing simple image upload in HTML5 _html5 tutorial skills
I searched for a solution. Some PCs replace this input with flash and use jquery tool libraries such as uploadify to do it. However, most browsers on the mobile side do not support flash. So the final method is to use the form form, just set the transparency of the form and input to 0, so that they and the content to be displayed are in the same div at the same time, and the displayed content can be made to look like you want. The code is as follows:
Upload pictures
It looks like the picture above. It is displayed in the p tag of "Upload Image". Clicking it will have the effect of selecting file
2. JS code
My side It is quite simple to write, just using the basic function of h5 upload
The html code is as follows, action is the path to be requested, what I do here is upload and modify the avatar when the file changes, and enter the name of the tag The attributes cannot be omitted, they are specifically related to the backend interface
The above content has shared with you the relevant knowledge about the problems and solutions encountered in implementing simple image upload in HTML5. I hope it will be helpful to everyone.