简体   繁体   English

不允许加载本地资源 - Eel Python

[英]not allowed to load local resource - Eel Python

When passing across a file location from eel to JavaScript, the image fails to load due to this error:将文件位置从 eel 传递到 JavaScript 时,由于以下错误,图像无法加载:

index.html:1 Not allowed to load local resource: file:///C:/Users/dave/Desktop/tools-and-utensils.png

Does the Eel python library allow the use of local files since it is running on a local host and not a web server? Eel python 库是否允许使用本地文件,因为它在本地主机而不是 web 服务器上运行? If so, how can I combat this?如果是这样,我该如何对抗? JavaScript is reading the path from a JSON string to load in the file. JavaScript 正在从 JSON 字符串读取路径以加载到文件中。

Perhaps try to move the python file TO the desktop and just call "tools-and-utensils.png"也许尝试将 python 文件移动到桌面,然后调用“tools-and-utensils.png”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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