마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

제발좀 알려주세요 ㅠㅠㅠㅠㅠㅠ이미지전송...

0 추천
HttpClient client = new DefaultHttpClient();
    HttpPost post = new HttpPost(url);
    
    File file = new File(mfilepath);
    FileBody bin = new FileBody(file);
    
    MultipartEntity multipart = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
    multipart.addPart("images",bin);
    
    post.setEntity(multipart);
    HttpResponse response = client.execute(post);
    HttpEntity resEntity = response.getEntity();
    
    Log.d("ErrorLog", "in");
    
    if(resEntity != null){
     String res = EntityUtils.toString(resEntity);
     Log.d("ErrorLog", res);
    }else{
     Log.d("ErrorLog", "null");
    }

 

이렇게 햇구요..

php부분좀 봐주세요 ㅠㅠ

 

<?php

 define('SITE_ROOT',realpath(dirname(__FILE__)));

 $myFile = $_FILES['images']['name']; // Storing name into variable
 $newFileName = (iconv('utf-8','euc-kr',$myFile));//===New string is concatenated====

 if (file_exists(SITE_ROOT."/talktalk/images/".$newFileName)){

 echo $newFileName." already exists. ";

 }else{
 
  move_uploaded_file($_FILES['images']['tmp_name'],SITE_ROOT."/talktalk/images/".$newFileName);

  echo "Success";
 }
?>

 

이렇게 햇는데..

에러가..

 

<b>Warning</b>:  move_uploaded_file() [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: Unable to move '/tmp/phpD7WxuT' to '/home/hosting_users/wizcompany/www/talktalk/images/talktalk/images/1367210371835.jpg' in <b>/home/hosting_users/wizcompany/www/talktalk/images/imageupload.php</b> on line <b>15</b><br />

 

이렇게 뜨거든요.. 경로가 없다는것 같은데.. 그래서 define문도 써보구.. 폴더두 확인 해보구 햇는데 ㅠㅠ

이게 몇일째 해결이 안되네요 ㅜㅜ 아시는 분 있으신가요?
mamongs (4,050 포인트) 님이 2013년 4월 29일 질문

1개의 답변

0 추천
옮기려는 폴더에 쓰기 권한 확인해보세요.
b22n (22,940 포인트) 님이 2013년 4월 29일 답변
ftp폴더 권한 확인해보라는 말씀이신가요?
...