Fixing issue with FileTransfer.upload when the passed in url contains a ?

This commit is contained in:
macdonst 2012-01-04 00:47:22 +08:00
parent 5fac30ea34
commit c66142d6b8

View File

@ -429,7 +429,12 @@ public class FileTransfer extends Plugin {
return ctx.getContentResolver().openInputStream(uri);
}
else if (path.startsWith("file://")) {
return new FileInputStream(path.substring(7));
int question = path.indexOf("?");
if (question == -1) {
return new FileInputStream(path.substring(7));
} else {
return new FileInputStream(path.substring(7, question));
}
}
else {
return new FileInputStream(path);