我正在使用以下tutorial將圖像文件上傳到網絡服務器。上傳文件到Web服務器時文件沒有找到異常?
並在此處獲取文件未找到異常。
try {
File uploadFile = new File(uriString);
// file path i receive **content:/media/external/images/media/2**
FileInputStream fis = this.openFileInput(uploadFile.getName()); // **ERRoR HERE**
HttpFileUploader htfu = new HttpFileUploader("http://finditnear.sigmatec.com.pk/inbox/send_remote_reply","noparamshere", uploadFile.getName());
htfu.doStart(fis);
}
catch (FileNotFoundException e) {
Toast.makeText(this, e.toString(), Toast.LENGTH_LONG).show();
e.printStackTrace();
return;
}
圖像文件存在,但仍然給我錯誤。
任何人都可以指導我解決什麼問題嗎?
Uri構造函數不存在 反正謝謝是我得到了答案 InputStream fis = \t this.getContentResolver()。openInputStream(Uri.parse(uriString)); – UMAR 2010-07-20 06:56:39
Ri ght,我沒有構建代碼,只是鍵入:-) – Fedor 2010-07-20 07:10:03