An example of ajax that uploads an image to the background and reads it,

Source: Internet
Author: User

An example of ajax that uploads an image to the background and reads it,

You can upload images in either of the following ways:

1. fileReader can parse the image into a base64 format, which is simple and rude.

2. canvas can re-draw an image. You can first put the blob of the obtained image into the canvas, regenerate the image with a width and transparency, and then convert it to the corresponding type and upload it to the background, currently, png and jpeg formats are supported.

The example of uploading images to the backend and reading the above ajax is all the content shared by Alibaba Cloud. I hope you can give us a reference and support for the customer's house.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.