简体   繁体   中英

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. 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?

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. 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. Later on this will be set as src="data:image/png;base64,<YOUR_RESPONSE_DATA>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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