-
Android How to upload image into the server using Volley library
about 9 years ago
-
about 9 years ago
Hello Bharat,
Please check line no 2 of your code in uploadImage() method,
error String url = "http:/plantnow.net16.net/uploaded.php"; correction String url = "http://plantnow.net16.net/uploaded.php";
please find the attached working code that i tested with the url you provided on my server its working but in case of the server you are using i am getting the following response.
Error
<!-- Hosting24 Analytics Code --> <script type="text/javascript" src="http://stats.hosting24.com/count.php"></script> <!-- End Of Analytics Code -->
that seems the part of php end that is not allowing to upload the image.
-
-
almost 9 years ago
Amit,
Any update on my question?
-
-
about 9 years ago
Hi Bharat,
Please mark the answer as correct if you find it helped you. For your second query that is uploading image from camera its similar as gallery you need to change the request code and open camera then after just do the same thing, will update you with the code soon.
Enjoy codeing :)
-
-
about 9 years ago
Amit ,
Thanks for reply. Yes you are correct. I have changed.
But i want to upload images captured from my camera.
-
-
about 9 years ago
Look ,We have two methods for uploading images to server
Using Multipart request.
Sending the image String to server.
In volley we can use both of them. But your case is second one.
This is Volley's post request that you are using and it should work .
Are you using proper internet permission in your manifest?
-
-
about 9 years ago
Devesh,
My php is working fine. My question is How to upload images using volley. And I have already decoded image.
How to store captured image and after uploading to server, it should show message "image uploaded"
-
-
about 9 years ago
Hello bharat , your code is converting the image into encoded string and Sending that String to server.
You need to decode that String in PHP Script.
<php> // $data is post image string $data = base64_decode($data); </php>
Reference:
http://php.net/manual/en/function.imagecreatefromstring.php
-
7 Answer(s)