0
안녕하세요 여러분, 다음 코드를 사용하고 있지만 error0가 응답으로 표시됩니다. 성공하려면 다음 코드를 따르십시오.Android에서 PHP SERver로 비디오를 업로드하는 방법
public void video()
{
File file = new File(exsistingFileName);
try {
HttpClient client = new DefaultHttpClient();
String postURL = "http://10.0.0.27/sportscloud/devices/uploadBlogData.php";
HttpPost post = new HttpPost(postURL);
FileBody bin = new FileBody(file);
MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
reqEntity.addPart("email", new StringBody("[email protected]", "text/plain", Charset.forName("UTF-8")));
reqEntity.addPart("gameId", new StringBody("1024", "text/plain", Charset.forName("UTF-8")));
reqEntity.addPart("source", new StringBody("phone", "text/plain", Charset.forName("UTF-8")));
reqEntity.addPart("uploadfile",bin);
post.setEntity(reqEntity);
HttpResponse response = client.execute(post);
HttpEntity resEntity = response.getEntity();
if (resEntity != null) {
Log.i("RESPONSE",EntityUtils.toString(resEntity));
}
} catch (Exception e) {
e.printStackTrace();
}
}