0

I have an android app, that connectos to the remote database with PHP+json

but now, i have to store photos of the users on the remote server. I need to do it storing the URL of the uploaded photo in a row of the USER TABLE. That is not the problem. The problem is that i have not idea about with a given path of a photo, how to upload it into a dir of the remote server of my app?

as i know, i need two things, a function that connects with a PHP and gives to the PHP the photo, and a PHP that receives the photo and uploads it into a dir of the remote database.

Well....¿can someone help me to do it?

I checked a lot of tutorials of doing this with PHP but i can't find a easy one that how to do it with android+php+mysql, all i am finding is too hard for me.

can someone give me the code i need to do it?

thanks

EDIT:

there does not exist a simple function and a simple PHP code that does it? Simple ones, the examples you are giving me are very hard for my skills with this and i can't apply to my android app and my remote server

Nabin
  • 11,216
  • 8
  • 63
  • 98
NullPointerException
  • 36,107
  • 79
  • 222
  • 382

2 Answers2

1

For the PHP side: http://it.php.net/manual/en/features.file-upload.php (there are a lot of sample)

For the Android side: this article explains hot to use DefaultHttpClient for make and upload via HTTP

Francesco Laurita
  • 23,434
  • 8
  • 55
  • 63
1

For the Android part, its just straight Java, and there are loads of examples of using HttpClient to perform file uploads.

Community
  • 1
  • 1
dave.c
  • 10,910
  • 5
  • 39
  • 62
  • also i have that link, like the one of the answer of Francesco, and also its too hard for me, please, if you can, give me the code to do it – NullPointerException Jan 31 '11 at 22:34
  • @AndroidUser99 Unsurprisingly, I'm not going to write an android app, a PHP app and a DAO layer for you. I'm happy to point you in the right direction and help when you run into problems, but I really don't have the time to do all your work for you. – dave.c Jan 31 '11 at 22:54