This time I will bring you how to use ajax to upload picturessave them to the background for reading, and use ajax to upload pictures and save them for background readingnotes What are they? Here are actual cases. Let’s take a look.
There are two ways to upload images:
1.fileReader can parse the image into base64 code format , simple and crude
2.canvas You can redraw a picture. You can first put the blob of the obtained picture into the canvas, then generate the picture with width, height and transparency, and then convert Pass it to the background into the corresponding type. Currently, png and jpeg formats are supported.
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to php Other related articles on the Chinese website!
Recommended reading:
Use Ajax and forms to implement the functions required for registered users
ajax to implement dynamic pie charts and columns Detailed explanation of graphic diagram
The above is the detailed content of How to use ajax to upload pictures and save them to the background for reading. For more information, please follow other related articles on the PHP Chinese website!