显示上传的图片

时间:2017-01-25 08:29:59

标签: javascript jquery image file browser

经过一些研究What is the best place for storing uploaded images, SQL database or disk file system?,我决定将上传的图片存储在文件系统中,例如C:/images/image.jpg,并将此路径存储到数据库中。 现在当我想通过设置属性src =" C:/images/image.jpg"来显示图片时我在控制台中遇到错误 -

  

不允许加载本地资源:

显示存储在文件系统中的图像的正确方法是什么?

1 个答案:

答案 0 :(得分:0)

我发现此网站https://howtoprogramwithjava.com/how-to-display-images-stored-on-a-server/解决了我的问题。我不得不为webapp设置上下文路径。

相关问题