【发布时间】:2013-05-22 17:35:55
【问题描述】:
我通过 android 中的 HTTPPost 发送文件:
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
InputStreamEntity reqEntity = new InputStreamEntity(new FileInputStream(file), -1);
reqEntity.setContentType("binary/octet-stream");
reqEntity.setChunked(true); // Send in multiple parts if needed
httppost.setEntity(reqEntity);
HttpResponse response = httpclient.execute(httppost);
在 PHP 中我如何获取文件?
【问题讨论】:
标签: php android file-upload http-post