Hi,
I am working on an extension that allows users to save the email they want to send in a file. So when they click the send button a filePicker appears and they can select the file path and save it. I would also like to cancel the mail sending process and drop them back to email editing if they click the cancel button on the file picker. I am not sure how to achieve this. Anybody has an idea??
Thanks in advance
extension development filepicker
- DanRaisch
- Moderator
- Posts: 127231
- Joined: September 23rd, 2004, 8:57 pm
- Location: Somewhere on the right coast
Re: extension development filepicker
Moving to Extension Development.
Also you may be reinventing the wheel... https://addons.mozilla.org/en-US/thunde ... -and-file/
Also you may be reinventing the wheel... https://addons.mozilla.org/en-US/thunde ... -and-file/
-
- Posts: 1168
- Joined: September 16th, 2007, 8:01 am
Re: extension development filepicker
var fp = Cc['@mozilla.org/filepicker;1'].createInstance(Ci.nsIFilePicker);
fp.init(Services.wm.getMostRecentWindow(null), myServices.sb.GetStringFromName('pick_img'), Ci.nsIFilePicker.modeOpen);
fp.appendFilters(Ci.nsIFilePicker.filterImages);
var rv = fp.show();
if (rv == Ci.nsIFilePicker.returnOK) {
}// else { // cancelled }
docs: https://developer.mozilla.org/en-US/doc ... er#Example
fp.init(Services.wm.getMostRecentWindow(null), myServices.sb.GetStringFromName('pick_img'), Ci.nsIFilePicker.modeOpen);
fp.appendFilters(Ci.nsIFilePicker.filterImages);
var rv = fp.show();
if (rv == Ci.nsIFilePicker.returnOK) {
}// else { // cancelled }
docs: https://developer.mozilla.org/en-US/doc ... er#Example