1

I am developing an application to upload an image from Android mobile to the web server. On the android side, I am using the code as mentioned in the link here Android file uploader with server-side php

On the server side, when I try to receive the file, it fails in move_uploaded_file function. The apache server side php code is

$target_path="uploads/";

$target_path=$target_path.basename($_FILES['uploadedfile']['name']);

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path)) {

echo "OK";

}else{

echo "FAIL"; }

The problem is that the file is not getting copied in the uploads folder. Can anyone please help?

Rgds, Sapan

Community
  • 1
  • 1
Sapan
  • 1,593
  • 3
  • 24
  • 34
  • check error_log and access_log. May be permission issue of uploads folder. – sat Jul 12 '11 at 08:15
  • nothing in error log and access log. Also checked for the permissions of the folder. It is not read only – Sapan Jul 12 '11 at 08:41
  • May also be permissions on the /tmp directory (or wherever PHP is configured to write uploads). Echoing out $_FILES['uploadedfile']['tmp_name'] may shed some light. Personally I'd knock together an HTML test harness to be 100% sure it isn't the client. – AlexJReid Jul 12 '11 at 08:45
  • I echoed the $_FILES['uploadedfile']['tmp_name'] and it displays icon.png which is the file I am trying to upload...I have no knowledge on php and html..so dont know how to write the html test – Sapan Jul 12 '11 at 09:14
  • Exact duplicate as http://stackoverflow.com/questions/5085629/android-image-upload-problem – Dharmendra Jul 28 '11 at 12:22

0 Answers0