extension development filepicker

Talk about add-ons and extension development.
Post Reply
nyavinci
Posts: 1
Joined: August 21st, 2015, 4:07 am

extension development filepicker

Post by nyavinci »

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
User avatar
DanRaisch
Moderator
Posts: 127231
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: extension development filepicker

Post by DanRaisch »

Moving to Extension Development.

Also you may be reinventing the wheel... https://addons.mozilla.org/en-US/thunde ... -and-file/
Noitidart
Posts: 1168
Joined: September 16th, 2007, 8:01 am

Re: extension development filepicker

Post by Noitidart »

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
Post Reply