Carregar arquivo - Android para Google App Engine (PHP)
Do meu aplicativo Android ao Google App Engine, estou postando um arquivo zip; Também estou postando uma string. Quando o script PHP do Google App Engine é executado, despejo o valor de $ _FILES no log por ...
ob_start();
var_dump($_FILES);
$result = ob_get_clean();
syslog(LOG_DEBUG, "VAR DUMP\n" . $result . "\n");
Também registro o valor da sequência. O Log possui a saída da string, mas não possui a saída despejada $ _FILES. Eu liESSE LINK, mas isso parece pertencer à Web. Meu código Android para POSTAR o arquivo é o seguinte ...
private void postExamplesZipToDrive(File file_zip){
RequestParams request_params = new RequestParams();
request_params.put("test", "Came thru");
//
try{ request_params.put("file_zip", file_zip); }
catch(FileNotFoundException e){
Log.e("postExamplesZipToDrive", "File not found");
Toast.makeText(this, "Unable to upload.", Toast.LENGTH_SHORT).show();
return;
}
AsyncHttpClient async_http_client = new AsyncHttpClient();
async_http_client.post(UPLOAD_URL, request_params, new JsonHttpResponseHandler(){
@Override
public void onSuccess(int code_status, Header[] headers, JSONArray success) {
Toast.makeText(getApplicationContext(), "" + code_status, Toast.LENGTH_SHORT).show();
super.onSuccess(code_status, headers, success);
}
@Override
public void onFailure(int code_status, Header[] headers, String string_response, Throwable throwable){
Toast.makeText(getApplicationContext(), "" + code_status, Toast.LENGTH_SHORT).show();
Log.e("onFailure", code_status + "\n" + string_response);
}
});
}
Minha pergunta é, estou postando o arquivo .zip corretamente? Como capturar os arquivos carregados que geralmente são armazenados em $ _FILES?