在对What is the best place for storing uploaded images, SQL database or disk file system?进行了一些研究之后,我决定将上传的图片存储在文件系统上,例如C:/images/image.jpg,并将此路径存储到数据库中。现在,当我想通过设置属性src=“C:/image.jpg”来显示图片时,我在控制台中得到了错误-
不允许加载本地资源:
显示存储在文件系统中的图像的正确方法是什么?
发布于 2017-01-25 10:52:32
我发现这个网站https://howtoprogramwithjava.com/how-to-display-images-stored-on-a-server/解决了我的问题。我必须为webapp设置一个上下文路径。
https://stackoverflow.com/questions/41846685
复制相似问题