In this example uploading an image from sdcard to web server.
1. place an image on sdcard.
2. place sdcard image path and image name in UploadToServer.java. ( see below )
3. create a php script (UploadToServer.php) at server. ( see below )
4. place php script path in UploadToServer.java. ( see below )
5. create folder name uploads on server where you have placed php script.
6. give permission 777 (read/write/execute) to uploads folder.
Project Structure :
Upload Image Sdcard View :
File : AndroidManifest.xml
File : res/layout/activity_upload_to_server.xml
File : src/UploadToServer.java
Php script at server :
File : UploadToServer.php
Show uploaded image at server :