How can i store images in database without uploading them using PHP script. I mean is there a way that i can put the images on apache server directory and then store their index like path to the database?
Asked
Active
Viewed 37 times
0
-
How do you expect the image to be transferred to the server directory if not via PHP or another backend technology? – hering Mar 02 '17 at 14:32
-
well...i had a thought in mind that the images would be put somewhere on the server directory, So i thought if there is a way that i can put the images on apache server directory somewhere and then do further code? – Anand Singh Mar 06 '17 at 01:56
-
Do you want (A) your users to upload images or do you want (B) to upload images yourself and use it in your application? (A): Your question should be more specific, the possible answers are way too broad (B): This is basic knowledge and an answer would also be too broad. There are plenty of tutorials on how to create a website including file upload to a web server. – hering Mar 06 '17 at 09:19
-
No...I don't want anything with the users....i only want to use it in my android application...it's just for backend...there's no website or anything..... – Anand Singh Mar 06 '17 at 15:29
1 Answers
0
You can upload your images to your server and store the path to your images as a text in your database or you can store your images base64-encoded. If you store the path you need to ensure that the images are accessible from your android app.
- Image to base64 String (e.g. JavaScript): How to convert image into base64 string using javascript
- Display base64-image-string: Embedding Base64 Images
-
-
-
Imho this is too basic for SO, but may you have a look at: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Upload_files_to_a_web_server or search for it on google/bing/whatever. There are plenty of (good) results. – hering Mar 07 '17 at 07:45