how to show an uploaded image on jsp page

2019-07-31 08:42发布

when I am uploading an image into serverside, and saved in a specific folder. Then on the next page I have to show that uploaded image. But I cant show it using the html img tag . what is wrong with this?.Can any one help me to solve this problem?

1条回答
对你真心纯属浪费
2楼-- · 2019-07-31 09:16

You likely need to make sure that the folder that you are uploading the images is accessible through the web server your are using, this would mean both that it's location is mapped to something on the web server and also that the web server has permission to read the image files after they have been created.

I would start by looking to make sure that the files are actually showing up in the folder that you expect them to be in, and that they aren't being cleared out by something.

Second, check if you manually place an image in that folder if you can navigate to the url of the image. If you can't it likely isn't mapped or there is a permissions issue.

You can test to see if the URLs of the images are working. Instead of just checking it through an img tag, navigate to the URL directly and see if you get some kind of an error, this might help you troubleshoot the issue.

查看更多
登录 后发表回答