mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 19:25:43 +00:00
fix for bug#37180 -change nsIFileSpecWithUI to nsIFilePicker; r=scottip
This commit is contained in:
parent
81ec9d522b
commit
d0be445fde
@ -989,13 +989,16 @@ function AttachFile()
|
||||
{
|
||||
dump("AttachFile()\n");
|
||||
currentAttachment = "";
|
||||
|
||||
// Get a local file, converted into URL format
|
||||
try {
|
||||
var filePicker = Components.classes["component://netscape/filespecwithui"].createInstance();
|
||||
filePicker = filePicker.QueryInterface(Components.interfaces.nsIFileSpecWithUI);
|
||||
currentAttachment = filePicker.chooseFile(Bundle.GetStringFromName("chooseFileToAttach"));
|
||||
}
|
||||
//Get file using nsIFilePicker and convert to URL
|
||||
try {
|
||||
var fp = Components.classes["component://mozilla/filepicker"].createInstance(nsIFilePicker);
|
||||
fp.init(window, Bundle.GetStringFromName("chooseFileToAttach"), nsIFilePicker.modeOpen);
|
||||
fp.appendFilters(nsIFilePicker.filterAll);
|
||||
if (fp.show() == nsIFilePicker.returnOK) {
|
||||
currentAttachment = fp.fileURL.spec;
|
||||
dump("nsIFilePicker - "+currentAttachment+"\n");
|
||||
}
|
||||
}
|
||||
catch (ex) {
|
||||
dump("failed to get the local file to attach\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user