Store and retrieve image from WAMP server using Android

I have one Android application in which the admin user can create a regular user account, in which the admin user can select a regular user photo to create an account. Everything works fine until I keep the normal username, age ETC. But the problem occurs when I want to save an ordinary user image in the database. I use the wamp server as the end database.

Can you guys suggest me how to store the image on the WAMP server, and also how to restore it again so that I can display the android activity.

The functionality is similar, Admin User login ----> Create regular user → Select image → Save to database.

Normal user login ---> Get image from database → View image in Android activity.

+3
source share
4 answers

I think you are trying to save images in a database, and an ordinary user can see them. I think your problem is how to store images in a database, right? If I am right, you can store image names instead of imagse, as you would preserve age and name.

, , . , URL-/, .

, "image1.jpg", , , URL-, , , , URL-, .

image_jpg image_png, image_gif .. , . id, type name , URL- ,

.....................

id   | type |name

0001 | jpg  |image1

0002 | gif  |image2

.....................

, /URL. URL-

0001 is   "path/image_jpg/image1."+type
0002 is   "path/image_gif/image2."+type

, , URL- ...

+7

webservice. :

.

 1. create webservice to accept image as base64 string.
 2. convert base64 to image and store on server directory.
 3. save the path of image in DB.

. .

 1. create webservice to send image to client device
 2. retrieve image path from DB.
 3. generate Image URL and sent it as response to client device

android

.

 1. convert image to base64 String.
 2. call webservice to send image as base64 String.

.

 1. call webservice to retrieve image URL.(Best way to get image is using lazzy loading)
+4

, http post Wamp. /, multipart-.

db,  1. , , .  2. URL-, .

+1

create a database create a table with an image attribute (the data type of the record is blob) insert into the table_name values ​​(load_file ("location of the image where the image is stored")) then make and open the image

0
source

All Articles