mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 945952 - Fix uploading of files with empty MIME type. r=fabrice
--HG-- extra : rebase_source : 3a5f56c241d98cc9a472cf94add10ae4d8f88fcb
This commit is contained in:
parent
c4f182ab0d
commit
25921341ff
@ -47,8 +47,8 @@ FilePicker.prototype = {
|
||||
/* members */
|
||||
|
||||
mParent: undefined,
|
||||
mExtraProps: {},
|
||||
mFilterTypes: [],
|
||||
mExtraProps: undefined,
|
||||
mFilterTypes: undefined,
|
||||
mFileEnumerator: undefined,
|
||||
mFilePickerShownCallback: undefined,
|
||||
|
||||
@ -56,6 +56,8 @@ FilePicker.prototype = {
|
||||
|
||||
init: function(parent, title, mode) {
|
||||
this.mParent = parent;
|
||||
this.mExtraProps = {};
|
||||
this.mFilterTypes = [];
|
||||
this.mMode = mode;
|
||||
|
||||
if (mode != Ci.nsIFilePicker.modeOpen &&
|
||||
@ -177,12 +179,13 @@ FilePicker.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
var mimeSvc = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService);
|
||||
var mimeInfo = mimeSvc.getFromTypeAndExtension(data.result.blob.type, '');
|
||||
|
||||
var name = 'blob';
|
||||
if (mimeInfo) {
|
||||
name += '.' + mimeInfo.primaryExtension;
|
||||
if (data.result.blob.type) {
|
||||
let mimeSvc = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService);
|
||||
let mimeInfo = mimeSvc.getFromTypeAndExtension(data.result.blob.type, '');
|
||||
if (mimeInfo) {
|
||||
name += '.' + mimeInfo.primaryExtension;
|
||||
}
|
||||
}
|
||||
|
||||
let file = new this.mParent.File(data.result.blob,
|
||||
|
Loading…
Reference in New Issue
Block a user