简体   繁体   中英

Why do I get a “Not allowed to load local resource” error message?

I upload a file from my local path and then I want to display the image as preview on hovering the link. But I always get this error:

Not allowed to load local resource: file:///C://Users//Public//Pictures//ResimKayit/test_2018112116256.jpg

I tried a lot of solutions, but they didn't work. Is there anyone who can help me?

  <link href="http://codegena.com/assets/css/image-preview-for-link.css" rel="stylesheet" /> <script type="text/javascript"> $(function () { $('#td1 a').miniPreview({ prefetch: 'pageload' }); }); </script> <script src="http://codegena.com/assets/js/image-preview-for-link.js"></script> 
 <td id="td1"> <a href='<%#GetPrameterValue("FILELOCATION") + "/" + Eval("FILENAME")%>' onclick="OpenAnExternalFile('<%# GetPrameterValue("FILELOCATION") + "/" + Eval("FILENAME") %>')"><%# Eval("FILENAME") %></a> <asp:HiddenField ID="hdnID" runat="server" Value='<%#Eval("ID")%>' /> <asp:HiddenField ID="hdnName" runat="server" Value='<%#Eval("FILENAME")%>' /> </td> 

Try looking at this question it seems like you are in a similar situation

THREE.js - Can't load texture locally

They were trying to use a texture for three.js but the same security protocol stopped them from loading an image. You could probably use one of their solutions to get around this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM