简体   繁体   中英

How to get Data Uri from a file system image with javascript (localhost is not an option)

我正在写一个可在mozilla上离线运行的javascript应用程序。我需要从文件系统中获取一个图像并将其读取为datauri(没有拖放或输入,必须由url自动完成).Localhost不是一个选择。另一种方法是从封闭网络的URL中获取此图像,但应用程序无法在该网络上,因此我无法使用来自文件系统的Ajax调用。任何解决方案?

Browsers javascript implementation doesn't have access to local file system due security considerations. You will have to run some sort of web server to serve that file.

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