java - 异步上传图片无法即时回显
阿神
阿神 2017-04-18 10:53:11
0
3
534

我用ajax+struts2将文件上传到了项目下的指定路径,在不刷新页面的情况下无法正常显示图片,有什么解决办法吗?求大佬指点。

阿神
阿神

闭关修行中......

reply all(3)
洪涛

Just check this in the workspace

迷茫

It is best to rename the image path saved on the server, otherwise there will be caching problems.
After ajax uploads the image, the server generates the path name and returns it to the front desk. The front desk then sets a new image path.

伊谢尔伦

The image saved to the server needs to have a unique name, then return the full path of the image to ajax, and then modify the attributes that need to be echoed

You can use the returned path to try it directly in the browser. If it works in the browser, then the page will also work

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template