Skip to content

Commit

Permalink
Add workaround to upload file:/// uri
Browse files Browse the repository at this point in the history
  • Loading branch information
daohoangson committed Feb 22, 2017
1 parent 8a7e71e commit 3923985
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,13 @@ void uploadAttach(Uri uri) {
}
String serverUrl = mDiscussion.getPostAttachmentsUrl(getAttachmentHash(), accessToken);

String path = uri.toString();
if (path.startsWith("file:///")) {
path = path.substring(7);
}

String uploadId = new MultipartUploadRequest(getContext(), serverUrl)
.addFileToUpload(uri.toString(), Api.PARAM_FILE)
.addFileToUpload(path, Api.PARAM_FILE)
.setUtf8Charset()
.setMaxRetries(2)
.setDelegate(new UploadStatusDelegate() {
Expand Down

0 comments on commit 3923985

Please sign in to comment.