fix for bug#37180 -change nsIFileSpecWithUI to nsIFilePicker; r=scottip

This commit is contained in:
varada%netscape.com 2000-06-23 01:38:59 +00:00
parent 81ec9d522b
commit d0be445fde

View File

@ -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");
}