Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,15 @@ private Result handleException(Context context, Exception ex, String code) {
}

private String GetMimeType(String url) {
String type = "*/*";
String type = "application/octet-stream";
String extension = MimeTypeMap.getFileExtensionFromUrl(url);
try {
if (extension != null && !extension.isEmpty()) {
type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());
String mimeType =
MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());
if (mimeType != null && !mimeType.isEmpty()) {
type = mimeType;
}
}
} catch (Exception ex) {
Log.d(TAG, "UploadWorker - GetMimeType", ex);
Expand Down