This article is a mirror article of machine translation, please click here to jump to the original article.

View: 17023|Reply: 0

[HTML/HTML5] Image preview is not allowed to load local resource

[Copy link]
Posted on 9/19/2016 10:53:18 AM | | |
Not allowed to load local resource: file:///C:/fakepath/red.jpg


No matter where our pictures are placed, the fakepath folder will be displayed, which is for browser security considerations.

It is not allowed to directly obtain the physical path of the file, this path, I don't know how to get it, we click on this path, we will find that we can't find this file

Of course, I can't find this document.

After selecting an image in chrome, it cannot be displayed
Select the image from the file selection box and assign the image control the src attribute
However, clicking the "Preview" button under chrome shows the error below
Not allowed to load local resource: file:///C:/fakepath/red.jpg image is placed on the desktop
------ solution ideas----------------------
Pass to the server using the path on the server

------ solution ideas----------------------
chrome browser can obtain the DataURL of the image through the html5 FileReader class to achieve local preview





Previous:HTML5 learning FileReader interface
Next:jquery.unobtrusive-ajax.min.js:5 Uncaught TypeError: a(...).live is not a fun...
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com