0

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?

Anand Singh
  • 59
  • 1
  • 7
  • 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 Answers1

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.

Community
  • 1
  • 1
hering
  • 1,956
  • 4
  • 28
  • 43
  • How can i upload my images to my server? – Anand Singh Mar 07 '17 at 01:44
  • and store the path in database?...that's what i want to know – Anand Singh Mar 07 '17 at 01:44
  • 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