Javascript cannot perform Base64 transcoding on remote images,

Source: Internet
Author: User

Javascript cannot perform Base64 transcoding on remote images,

Error reported when converting a web image to a Base64 code

Image from origin 'HTTP: // 114.215.87.123: 8900 'has been blocked from loading by Cross-Origin Resource Sharing policy: no 'access-Control-Allow-origin' header is present on the requested resource. origin 'HTTP: // localhost: 100' is therefore not allowed access.
The image has been blocked from loading the resource sharing policy from the Origin "http: // 114.215.87.123: 8900": the requested resource is not provided with the "Access-Control-Allow-Origin" header. The origin is "http: // localhost: 63342" and therefore cannot be accessed.

You can clearly see the error in the prompt information.

Add the config file to IIS.

Create a new web. config file.

Enter the following content:

<? Xml version = "1.0" encoding = "UTF-8"?> <Configuration> <system. webServer>  

Restart IIS (or restart IIS if not ).

 

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.