Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

internalSave with AutoChosen?

22 views
Skip to first unread message

Dan

unread,
Oct 21, 2006, 10:15:51 PM10/21/06
to
Hi,

I'm working on a firefox 2.0+ extension that creates and then saves the
contents of a canvas. It works fine, but I can't seem to get it save
the image (via the internalSave function in contentAreaUtils.js)
without popping up the save file picker dialog. Shouldn't setting the
AutoChosen file prevent the dialog from appearing? I've spent all day
trying to get this to work, so any suggestions would be really
appreciated. Here's the relevant code:

var localfile = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile)

localfile.initWithPath("c:\\image.jpg");

var localuri = makeFileURI(localfile);

internalSave(canvas.toDataURL('image/jpeg','quality=100'), null,
'image.jpg', null, 'image/jpeg', true, null, AutoChosen(localfile,
localuri), null);

Thanks,
Dan

0 new messages