Android FileNotFoundException:/storage/simulated/0/xyz/a bc/abc_06-07-2017 06-12-121481589883.amr
我正试图将文件从我的设备存储上传到云端,但每当我尝试上传时,我都会遇到以下问题Android FileNotFoundException:/storage/simulated/0/xyz/a bc/abc_06-07-2017 06-12-121481589883.amr,android,dropbox-api,filenotfoundexception,Android,Dropbox Api,Filenotfoundexception,我正试图将文件从我的设备存储上传到云端,但每当我尝试上传时,我都会遇到以下问题 java.io.FileNotFoundException: /storage/emulated/0/xyz/a bc/abc_06-07-2017 06-12-121481589883.amr: open failed: ENOENT (No such file or directory) 这是我的密码 DropboxInstance objDropboxInstance = new Drop
java.io.FileNotFoundException: /storage/emulated/0/xyz/a bc/abc_06-07-2017 06-12-121481589883.amr: open failed: ENOENT (No such file or directory)
这是我的密码
DropboxInstance objDropboxInstance = new DropboxInstance();
String filePath = intent.getExtras().getString("filePath");
// filePath is = /storage/emulated/0/xyz/a bc/abc_06-07-2017 06-12-121481589883.amr
StringBuilder sb = new StringBuilder();
InputStream is;
String name = "abc_06-07-2017 06-12-121481589883";
try {
File file = new File(filePath);
is = new FileInputStream(file);
long size = f.length();
objDropboxInstance.getDropBoxStorage(this).upload("/" + name, is, size, true);
}
catch(IOException ioe) {
ioe.printStackTrace();
}
我不知道发生了什么事。我认为这条路是正确的。但我不明白为什么我会犯这个错误。请推荐我 尝试缩短文件名并从文件路径中删除空格。@Ali文件名长度有限制吗?那么文件路径长度就不是问题了。你试过了吗?这可能有用