简体   繁体   English

在Web应用程序中的何处以及如何存储和检索图像?

[英]Where and How to store and Retrieve Images in Web Application?

Which is the recommended way to store images .Should it be stored in server or in cloud and how should it be retrieved to the client side in an Ecommerce web application which uses angular JS in client side and spring MVC4 hibernate 4 in server side. 建议使用哪种方式存储图像。应将其存储在服务器或云中,以及如何在电子商务Web应用程序中将其检索到客户端,该Web应用程序在客户端使用Angular JS在服务器端使用spring MVC4休眠4。 1]DO I have to convert each image into bytes and send it to client from server with a seperate servlet image handler 2]IS there any other way 3] i am able to get the images in client side to server and server can store the images in public directory like d drive but I am not able to access a public directory which is situated in my d drive within client side What should I do? 1] DO我必须将每个图像转换为字节,然后使用单独的servlet图像处理程序将其从服务器发送到客户端2] IS还有其他方法3]我能够将客户端中的图像发送到服务器,并且服务器可以存储公用目录(例如d驱动器)中的映像,但是我无法访问客户端d驱动器中的公用目录,该怎么办?

You can store images anywhere you want depending on its security concern. 您可以将图像存储在任何需要的位置,具体取决于其安全性。 If those images can be publicly accessible you can send its url/path in response which can be set as src by angular js app. 如果这些图像可以公开访问,则您可以发送其url / path作为响应,可以通过angular js应用将其设置为src But if its a security concerned and it will be according to role rights implementation then you should return as multipart/form-data (base64) in response. 但是,如果涉及安全性,并且将根据角色权限实现,那么您应该作为multipart/form-data (base64)返回。 Later on this will be set as src="data:image/png;base64,<YOUR_RESPONSE_DATA> 稍后将其设置为src="data:image/png;base64,<YOUR_RESPONSE_DATA>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM