Correctly report the mime type of 3ga files

This commit is contained in:
Simon MacDonald 2012-11-12 10:22:35 -05:00
parent 4fe73cf6ad
commit e95bde62a2

View File

@ -988,7 +988,12 @@ public class FileUtils extends CordovaPlugin {
// So we need to replace the space with a url encoded %20
String url = filename.replace(" ", "%20");
MimeTypeMap map = MimeTypeMap.getSingleton();
return map.getMimeTypeFromExtension(MimeTypeMap.getFileExtensionFromUrl(url));
String extension = MimeTypeMap.getFileExtensionFromUrl(url);
if (extension.toLowerCase().equals("3ga")) {
return "audio/3gpp";
} else {
return map.getMimeTypeFromExtension(extension);
}
}
/**