Android 사이드에서 PHP 서버로 파일 (이미지, 동영상 및 오디오)을 업로드하고 있습니다. 작은 파일에도 잘 작동합니다. 그러나 큰 파일의 경우 파일 업로드와 같은 예상치 못한 결과가 발생하지만 안드로이드 측면에서는 시간 초과 예외가 발생합니다. 파일 업로드에 대한 모든 시나리오를 어떻게 해결할 수 있는지 알려주세요. 어떻게 HttpMultipart 엔터티를 사용할 수 있으며 어떻게 다른 크기의 파일에 대해 상대 시간 제한을 설정할 수 있습니다. 내 코드는 다음과 같습니다loopj HttpClient를 사용하는 Android 파일 업로드
는File myFile = new File(filePath);
RequestParams params = new RequestParams();
try {
params.put("uploaded_file", myFile);
} catch (FileNotFoundException e) {
}
URL=getResources().getString(com.newing.R.string.server_adderess)+URL+fileType+"&lessonID="+LessonID;
client.post(URL, params, new AsyncHttpResponseHandler() {
@Override
public void onSuccess(String response) {
Log.w("async", "success!!!!");
UtilityFunctions.showNotification(getApplicationContext(),
"File uploading completed.");
stopSelf();
}
@Override
public void onFailure(Throwable error) {
Log.w("async", "failure!!!!");
UtilityFunctions.showNotification(getApplicationContext(),
"File couldn't upload. Please try later.");
stopSelf();
}
});
업로드에 대한 max_size 한도를 확인할 수 있습니까? 뭐라구? 그리고 타임 아웃 값은? –