Inherits From:nsISupports

This interface is implemented by the following components:


PRInt16 modeOpen = 0
PRInt16 modeSave = 1
PRInt16 modeGetFolder = 2
PRInt16 modeOpenMultiple = 3
PRInt16 returnOK = 0
PRInt16 returnCancel = 1
PRInt16 returnReplace = 2
PRInt32 filterAll = 1
PRInt32 filterHTML = 2
PRInt32 filterText = 4
PRInt32 filterImages = 8
PRInt32 filterXML = 16
PRInt32 filterXUL = 32
PRInt32 filterApps = 64


AString defaultExtension

The extension that should be associated with files of the type we want to work with. On some platforms, this extension will be automatically appended to filenames the user enters, if needed.

AString defaultString

The filename that should be suggested to the user as a default.

nsILocalFile displayDirectory

Set the directory that the file open/save dialog initially displays

readonly nsILocalFile file

Get the nsILocalFile for the file or directory.

readonly nsISimpleEnumerator files

Get the enumerator for the selected files only works in the modeOpenMultiple mode

readonly nsIFileURL fileURL

Get the nsIFileURL for the file or directory.

PRInt32 filterIndex

The filter which is currently selected in the File Picker dialog


void appendFilter ( AString title , AString filter ) void appendFilters ( PRInt32 filterMask ) void init ( nsIDOMWindow parent , AString title , PRInt16 mode ) PRInt16 show ( )

void appendFilter ( AString title , AString filter )

Add a filter

title: name of the filter
filter: extensions to filter -- semicolon and space separated

void appendFilters ( PRInt32 filterMask )

Append to the filter list with things from the predefined list


void init ( nsIDOMWindow parent , AString title , PRInt16 mode )

Initialize the file picker widget. The file picker is not valid until this method is called.

parent: nsIDOMWindow parent. This dialog will be dependent on this parent. parent must be non-null.
title: The title for the file widget
mode: load, save, or get folder

PRInt16 show ( )

Show File Dialog. The dialog is displayed modally.

returnOK if the user selects OK, returnCancel if the user selects cancel

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com