Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}The File plugin provides functionality to work with files.

Main features are:
- Creating temporary files
- Reading from and writing to the filesystem
- Retrieving information on files and directories on the file system 
- Streaming files between the Smart Client and the Server (and vise versa)\\
The stream methods are not directly useful for the WebClient, because this is really streaming of files between a client and a server, and the client code of the WebClient is already running on the server, so you are the streaming data withing the same process. The streaming for the webclientis handled by the browser code.

When using the File plugin, it's important to take into account the differences and compatibility between different clients:
- Interacting with the file system through the plugin in a Smart Client happens client-side, so on the machine where the Smart Client is launched. On all other clients (Web, Headless & Batchprocessor), the operations are performed on the Server.
- All showXxxxDialog(...) functions interact with the user through a UI. These function can only be used in Clients that provide a UI, like the Smart and Web Client.
- The showXxxxDialog(...) functions, when used in the Web Client, have certain limitations due to being operated in a browser. Browser security (currently) limits interaction with the local file system, except for single file select operations initiated by the user clicking a button.

Many functions work only in the smart client or only on the server in the Headless or WebClient, some work in the WebClient's browser and that is mentioned in the doc (WebClient enabled) most of the time an extra parameter or some certain state must be set like a callback function, because in the WebClient the function will not wait for a result and then return the result, but will go on, and then the callback is called when it is done. (like showFileOpenDialog)
You have no control directly of the real files in a a WebClient, so the files on the pc of the browser. You can't directly target them to load into the client, or with saving you can't specify the target directory where it is getting saved. This is all fully controlled by the browser.
When using the streaming features of the File plugin, make sure that you set the directory "servoy.FileServerService.defaultFolder" of the File server plugin settings in the admin page. Don't reply on the default behavior, specify your own writable directory.

Because the File plugin works with 3 different kind of files (LocalFiles on disk, RemoteFiles on the server when streaming is used and Uploaded files from the webclient when the browser uploads a file), not all things that you call on a JSFile object will give you data that you expect, for example a Uploaded file that you get back in the callback method of a showFileOpenDialog in the webclient does not represent an actual File object on the server. It is a binary data object (blob) that is only in memory, so getParentFile() or getPath() will return null in these cases, you don't get access or a reference to the file path or directory of the browsers pc. Also setBytes() will result in an exception. Best things to use is the getBytes() method if you want to get the bytes and store that, that will work for all 3 types. If you want to store the bytes that a webclient uploaded in another file the quickest way to do that is to use:

var fileOnServer = plugins.file.convertToJSFile('/path/to/file/on/server');

plugins.file.writeFile(fileOnServer,uploadedFile.getBytes());{sub-section}\\ 

{table:id=|class=servoy sReturnTypes}{tr:style=height: 30px;}{th}Return Types{th}{tr}{tr}{td}{span:class=sWordList}[JSFile]{span}{span:class=sWordList}[JSProgressMonitor]{span}{td}{tr}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Server Property Summary{th}{tr}{tbody}{tr}{td}{td}{td}[#servoy.FileServerService.defaultFolder]
{td}{tr}{tbody}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#appendToTXTFile]\(file/fileName, text)
Appends a string given in parameter to a file, using default \[encoding\])
Appends data into a text fileplatform encoding.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#appendToTXTFile]\(file, text, encoding)
Appends a string given in parameter to a file, using the specified encoding.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#convertToJSFile]\(file)
Returns a JSFile instance corresponding to an alternative representation of a file (for example a string).{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#convertToRemoteJSFile]\(serverPathpath)
Returns theConvenience return to get a JSFile objectrepresentation of a server file, based givenon its path (relative the default server location).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#copyFile]\(sourceFilesource, destinationFiledestination)
Copies the source file to the destination file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#copyFolder]\(sourceFoldersource, destinationFolderdestination)
Copies the sourcefolder to the destination folder, recursively.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#createFile]\(targetFile)
Creates a JSFile instance.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#createFolder]\(targetFolderdestination)
Creates a folder on disk.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#createTempFile]\(filePrefixprefix, fileSuffixsuffix)
Creates a temporary file on disk.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#deleteFile]\(targetFiledestination)
Removes a file from disk.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#deleteFolder]\(targetFolderdestination, showWarning)
Deletes a folder from disk recursively.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getDefaultUploadLocation]\()
Returns the default upload location path of the server.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#getDesktopFolder]\()
Returns a JSFile instance that corresponds to the Desktop folder of the currently logged in user.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]\[]{td}{td}[#getDiskList]\()
Returns an Array of JSFile instances correponding to the file system root folders.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getFileSize]\(targetFilepath)
Returns the size of the specified file.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]\[]{td}{td}[#getFolderContents]\(targetFolder, \[fileFilter\], \[fileOption(1=files,2=dirs)\],
\[visibleOption(1=visible,2=nonvisible)\], \[lockedOption(1=locked,2=nonlocked)\])
Returns an array of JSFile instances corresponding to content of the specified folder.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]\[]{td}{td}[#getHomeFolder#getFolderContents]\(targetFolder, fileFilter)
Returns aan array of JSFile instanceinstances corresponding to the homecontent folder of the loggedspecified in usedfolder.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]\[Date]{td}{td}[#getModificationDate#getFolderContents]\(targetFiletargetFolder, fileFilter, fileOption)
Returns the modification date of a file an array of JSFile instances corresponding to content of the specified folder.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]\[]{td}{td}[#getRemoteFolderContents#getFolderContents]\(targetFolder, \[fileFilter\], \[fileOption(1=files,2=dirs)\], \[visibleOption(1=visible,2=nonvisible)\],
\[lockedOption(1=locked,2=nonlocked)\])
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.{td}{tr}{tbody}{tbody}{tr}{td}[BooleanJSFile]\[]{td}{td}[#moveFile#getFolderContents]\(sourceFiletargetFolder, fileFilter, fileOption, visibleOption, destinationFilelockedOption)
Returns Movesan thearray fileof fromJSFile theinstances sourcecorresponding to content of the destinationspecified placefolder.{td}{tr}{tbody}{tbody}{tr}{td}byte[JSFile]{td}{td}[#readFile#getHomeFolder]\(\[file\], \[size\])
Reads all or part of the content from a binary file)
Returns a JSFile instance corresponding to the home folder of the logged in used.{td}{tr}{tbody}{tbody}{tr}{td}[StringDate]{td}{td}[#readTXTFile#getModificationDate]\(\[file\], \[charsetname\])
Read all content from a textpath)
Returns the modification date of a file.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]\[]{td}{td}[#showDirectorySelectDialog#getRemoteFolderContents]\(\[directory suggestion\], \[dialog title text\])
Shows a directory selector dialogtargetFolder)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]\[Object]{td}{td}[#showFileOpenDialog#getRemoteFolderContents]\(\[selectionMode(0=both,1=Files,2=Dirs)\], \[startDirectory(null=default/previous)\], \[multiselect(true/false)\], \[filterarray\], \[callbackmethod\], \[dialog title text\])
Shows a file open dialogtargetFolder, fileFilter)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]\[]{td}{td}[#showFileSaveDialog#getRemoteFolderContents]\(\[fileName/dir suggestion\], \[dialog title text\])
Shows a file save dialogtargetFolder, fileFilter, fileOption)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]\[JSProgressMonitor]{td}{td}[#streamFilesFromServer#getRemoteFolderContents]\(file/fileName|fileArray/fileNameArraytargetFolder, serverFile/serverFileName|serverFileArray/serverFileNameArray, \[callbackFunction\])
Streams a file orfileFilter, fileOption, visibleOption)
Returns an array of filesJSFile frominstances thecorresponding serverto incontent aof backgroundthe task to a file (or files)specified folder on the server clientside.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]\[JSProgressMonitor]{td}{td}[#streamFilesToServer#getRemoteFolderContents]\(file/fileName|fileArray/fileNameArray, \[serverFile/serverFileName|serverFileArray/serverFileNameArray\], \[callbackFunction\])
Streams a file ortargetFolder, fileFilter, fileOption, visibleOption, lockedOption)
Returns an array of filesJSFile toinstances thecorresponding serverto incontent aof backgroundthe taskspecified \-folder withon optionalthe relative path(s)/(new) name(s)server side.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#writeFile#moveFile]\(file, binary_data, \[mimeType\])
Writes data into a binary filesource, destination)
Moves the file from the source to the destination place.{td}{tr}{tbody}{tbody}{tr}{td}byte[Boolean]{td}{td}[#writeTXTFile#readFile]\(file, text_data, \[charsetname\], \[mimeType\])
Writes data into a text)
Reads all or part of the content from a binary file.{td}{tr}{tbody}{tbody}{tr}{td}byte[Boolean]{td}{td}[#writeXMLFile#readFile]\(file, xml_data)
WritesReads dataall intoor an XMLpart of the content from a binary file.{td}{tr}{tbody}{tbody}{tr}{td}{table}\\ 

{table:id=serverProperty|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Server Property Details{th}{tr}{tbody:id=servoy.FileServerService.defaultFolder|class=node}{tr:id=name}{td}h6.servoy.FileServerService.defaultFolder{td}{tr}{tr:id=des}{td}{sub-section:servoy.FileServerService.defaultFolder_des|text=|trigger=button}{sub-section}{sub-section:servoy.FileServerService.defaultFolder_des|trigger=none|class=sIndent}Set the default folder path (absolute path on the server) to save files sent by clients (will default to $ServoyInstallationDirectory$/server/webapps/ROOT/uploads/){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:servoy.FileServerService.defaultFolder_snc|text=|trigger=button}{sub-section}{sub-section:servoy.FileServerService.defaultFolder_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:servoy.FileServerService.defaultFolder_prs|text=|trigger=button}{sub-section}{sub-section:servoy.FileServerService.defaultFolder_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:servoy.FileServerService.defaultFolder_ret|text=|trigger=button}{sub-section}{sub-section:servoy.FileServerService.defaultFolder_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:servoy.FileServerService.defaultFolder_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:servoy.FileServerService.defaultFolder_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:servoy.FileServerService.defaultFolder_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:servoy.FileServerService.defaultFolder_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:servoy.FileServerService.defaultFolder_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:servoy.FileServerService.defaultFolder_sam|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=appendToTXTFile|class=node}{tr:id=name}{td}h6.appendToTXTFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}appendToTXTFile{span}{span:id=iets|style=float: left;}\(file/fileName, text, \[encoding\]){span}{td}{tr}{tr:id=des}{td}{sub-section:appendToTXTFile_des|text=|trigger=button}{sub-section}{sub-section:appendToTXTFile_des|trigger=none|class=sIndent}Appends data into a text file.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:appendToTXTFile_snc|text=|trigger=button}{sub-section}{sub-section:appendToTXTFile_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:appendToTXTFile_prs|text=|trigger=button}{sub-section}{sub-section:appendToTXTFile_prs|trigger=none|class=sIndent}file/fileName
text
\[encoding\]
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:appendToTXTFile_ret|text=|trigger=button}{sub-section}{sub-section:appendToTXTFile_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:appendToTXTFile_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:appendToTXTFile_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:appendToTXTFile_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:appendToTXTFile_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:appendToTXTFile_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:appendToTXTFile_sam|trigger=none}{code:language=javascript}
// append some text to a text file:
	var ok = plugins.file.appendToTXTFile('myTextFile.txt', '\nMy fantastic new line of text\n');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=convertToJSFile|class=node}{tr:id=name}{td}h6.convertToJSFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}convertToJSFile{span}{span:id=iets|style=float: left;}\(file){span}{td}{tr}{tr:id=des}{td}{sub-section:convertToJSFile_des|text=|trigger=button}{sub-section}{sub-section:convertToJSFile_des|trigger=none|class=sIndent}Returns a JSFile instance corresponding to an alternative representation of a file (for example a string).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:convertToJSFile_snc|text=|trigger=button}{sub-section}{sub-section:convertToJSFile_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:convertToJSFile_prs|text=|trigger=button}{sub-section}{sub-section:convertToJSFile_prs|trigger=none|class=sIndent}file
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:convertToJSFile_ret|text=|trigger=button}{sub-section}{sub-section:convertToJSFile_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:convertToJSFile_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:convertToJSFile_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:convertToJSFile_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:convertToJSFile_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:convertToJSFile_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:convertToJSFile_sam|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile("story.txt");
if (f.canRead())
	application.output("File can be read.");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=convertToRemoteJSFilebyte[]{td}{td}[#readFile]\(file, size)
Reads all or part of the content from a binary file.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#readTXTFile]\()
Read all content from a text file.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#readTXTFile]\(file)
Read all content from a text file.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#readTXTFile]\(file, charsetname)
Read all content from a text file.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#showDirectorySelectDialog]\()
Shows a directory selector dialog.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#showDirectorySelectDialog]\(directory)
Shows a directory selector dialog.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#showDirectorySelectDialog]\(directory, title)
Shows a directory selector dialog.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#showFileOpenDialog]\()
Shows a file open dialog.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#showFileOpenDialog]\(selectionMode)
Shows a file open dialog.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#showFileOpenDialog]\(selectionMode, startDirectory)
Shows a file open dialog.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#showFileOpenDialog]\(selectionMode, startDirectory, multiselect)
Shows a file open dialog.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#showFileOpenDialog]\(selectionMode, startDirectory, multiselect, filter)
Shows a file open dialog.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#showFileOpenDialog]\(selectionMode, startDirectory, multiselect, filter, callbackmethod)
Shows a file open dialog.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#showFileOpenDialog]\(selectionMode, startDirectory, multiselect, filter, callbackmethod, title)
Shows a file open dialog.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#showFileOpenDialog]\(selectionMode, startDirectory, multiselect, callbackmethod)
Shows a file open dialog.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#showFileOpenDialog]\(selectionMode, startDirectory, callbackmethod)
Shows a file open dialog.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#showFileOpenDialog]\(selectionMode, callbackmethod)
Shows a file open dialog.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#showFileOpenDialog]\(callbackmethod)
Shows a file open dialog.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#showFileSaveDialog]\()
Shows a file save dialog.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#showFileSaveDialog]\(fileNameDir)
Shows a file save dialog.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#showFileSaveDialog]\(fileNameDir, title)
Shows a file save dialog.{td}{tr}{tbody}{tbody}{tr}{td}[JSProgressMonitor]{td}{td}[#streamFilesFromServer]\(f, s)
Stream 1 or more file from the server to the client.{td}{tr}{tbody}{tbody}{tr}{td}[JSProgressMonitor]{td}{td}[#streamFilesFromServer]\(f, s, callback)
Stream 1 or more files from the server to the client, the callback method is invoked after every file, with as argument
the filename that was transfered.{td}{tr}{tbody}{tbody}{tr}{td}[JSProgressMonitor]{td}{td}[#streamFilesToServer]\(f)
Overloaded method, only defines file(s) to be streamed{td}{tr}{tbody}{tbody}{tr}{td}[JSProgressMonitor]{td}{td}[#streamFilesToServer]\(f, o)
Overloaded method, defines file(s) to be streamed and a callback function{td}{tr}{tbody}{tbody}{tr}{td}[JSProgressMonitor]{td}{td}[#streamFilesToServer]\(f, s, callback)
Overloaded method, defines file(s) to be streamed, a callback function and file name(s) to use on the server{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#writeFile]\(f, data)
Writes data into a binary file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#writeFile]\(f, data, mimeType)
Writes data into a binary file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#writeTXTFile]\(file, text_data)
Writes data into a text file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#writeTXTFile]\(file, text_data, charsetname)
Writes data into a text file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#writeTXTFile]\(file, text_data, charsetname, mimeType)
Writes data into a text file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#writeXMLFile]\(file, xml_data)
Writes data into an XML file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#writeXMLFile]\(file, xml_data, encoding)
Writes data into an XML file.{td}{tr}{tbody}{table}\\ 

{table:id=serverProperty|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Server Property Details{th}{tr}{tbody:id=servoy.FileServerService.defaultFolder|class=node}{tr:id=name}{td}h6.servoy.FileServerService.convertToRemoteJSFiledefaultFolder{td}{tr}{tr:id=sigdes}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}convertToRemoteJSFile{span}{span:id=iets|style=float: left;}\(serverPath){span}{td}{tr}{tr:id=des}{td}{sub-section:convertToRemoteJSFile_des|text=|sub-section:servoy.FileServerService.defaultFolder_des|text=|trigger=button}{sub-section}{sub-section:convertToRemoteJSFileservoy.FileServerService.defaultFolder_des|trigger=none|class=sIndent}ReturnsSet the JSFile object of a server file, given its path (relative the default server location).default folder path (absolute path on the server) to save files sent by clients (will default to $ServoyInstallationDirectory$/server/webapps/ROOT/uploads/){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:convertToRemoteJSFileservoy.FileServerService.defaultFolder_snc|text=|trigger=button}{sub-section}{sub-section:convertToRemoteJSFileservoy.FileServerService.defaultFolder_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:convertToRemoteJSFileservoy.FileServerService.defaultFolder_prs|text=|trigger=button}{sub-section}{sub-section:convertToRemoteJSFileservoy.FileServerService.defaultFolder_prs|trigger=none|class=sIndent}serverPath
{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:convertToRemoteJSFileservoy.FileServerService.defaultFolder_ret|text=|trigger=button}{sub-section}{sub-section:convertToRemoteJSFileservoy.FileServerService.defaultFolder_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:convertToRemoteJSFileservoy.FileServerService.defaultFolder_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:convertToRemoteJSFileservoy.FileServerService.defaultFolder_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:convertToRemoteJSFileservoy.FileServerService.defaultFolder_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:convertToRemoteJSFileservoy.FileServerService.defaultFolder_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:convertToRemoteJSFileservoy.FileServerService.defaultFolder_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:convertToRemoteJSFileservoy.FileServerService.defaultFolder_sam|trigger=none}{code:language=javascript}
var f = plugins.file.convertToRemoteJSFile('/story.txt');
if (f && f.canRead())
	application.output('File can be read.');
{code}{sub-section}{div}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=copyFileappendToTXTFile-Object_String|class=node}{tr:id=name}{td}h6.copyFileappendToTXTFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}copyFileappendToTXTFile{span}{span:id=iets|style=float: left;}\(sourceFilefile, destinationFiletext){span}{td}{tr}{tr:id=des}{td}{sub-section:copyFileappendToTXTFile-Object_String_des|text=|trigger=button}{sub-section}{sub-section:copyFileappendToTXTFile-Object_String_des|trigger=none|class=sIndent}Copies the source fileAppends a string given in parameter to the destinationa file., Returnsusing truedefault if the copy succeeds, false if any error occursplatform encoding.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:copyFileappendToTXTFile-Object_String_snc|text=|trigger=button}{sub-section}{sub-section:copyFileappendToTXTFile-Object_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:copyFileappendToTXTFile-Object_String_prs|text=|trigger=button}{sub-section}{sub-section:copyFileappendToTXTFile-Object_String_prs|trigger=none|class=sIndent}sourceFile
destinationFile}\{[Object]} file -- either a File, a local JSFile or a the file path as a String
\{[String]} text -- the text to append to the file
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:copyFileappendToTXTFile-Object_String_ret|text=|trigger=button}{sub-section}{sub-section:copyFileappendToTXTFile-Object_String_ret|trigger=none|class=sIndent}[Boolean] -- true if appending worked{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:copyFileappendToTXTFile-Object_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:copyFileappendToTXTFile-Object_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:copyFileappendToTXTFile-Object_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:copyFileappendToTXTFile-Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:copyFileappendToTXTFile-Object_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:copyFileappendToTXTFile-Object_String_sam|trigger=none}{code:language=javascript}
// Copy based on file names.
if (!append some text to a text file:
	var ok = plugins.file.copyFileappendToTXTFile("story'myTextFile.txt"', "story.txt.copy"))
	application.output("Copy failed.");
// Copy based on JSFile instances.
var f = plugins.file.createFile("story.txt");
var fcopy = plugins.file.createFile("story.txt.copy2");
if (!plugins.file.copyFile(f, fcopy))
	application.output("Copy failed.");
'\nMy fantastic new line of text\n');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=copyFolderappendToTXTFile-Object_String_String|class=node}{tr:id=name}{td}h6.copyFolderappendToTXTFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}copyFolderappendToTXTFile{span}{span:id=iets|style=float: left;}\(sourceFolderfile, text, destinationFolderencoding){span}{td}{tr}{tr:id=des}{td}{sub-section:copyFolderappendToTXTFile-Object_String_String_des|text=|trigger=button}{sub-section}{sub-section:copyFolderappendToTXTFile-Object_String_String_des|trigger=none|class=sIndent}CopiesAppends thea sourcefolderstring togiven thein destinationparameter folder,to recursively.a Returnsfile, trueusing if the copy succeeds, false if any error occursspecified encoding.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:copyFolderappendToTXTFile-Object_String_String_snc|text=|trigger=button}{sub-section}{sub-section:copyFolderappendToTXTFile-Object_String_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:copyFolderappendToTXTFile-Object_String_String_prs|text=|trigger=button}{sub-section}{sub-section:copyFolderappendToTXTFile-Object_String_String_prs|trigger=none|class=sIndent}\{[Object]}sourceFolder destinationFolderfile {sub-section}{td}{-- either a File, a local JSFile or a the file path as a String
\{[String]} text -- the text to append to the file
\{[String]} encoding -- the encoding to use
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:copyFolderappendToTXTFile-Object_String_String_ret|text=|trigger=button}{sub-section}{sub-section:copyFolderappendToTXTFile-Object_String_String_ret|trigger=none|class=sIndent}[Boolean] -- true if appending worked{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:copyFolderappendToTXTFile-Object_String_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:copyFolderappendToTXTFile-Object_String_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:copyFolderappendToTXTFile-Object_String_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:copyFolderappendToTXTFile-Object_String_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:copyFolderappendToTXTFile-Object_String_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:copyFolderappendToTXTFile-Object_String_String_sam|trigger=none}{code:language=javascript}
// Copy folder based on names.
if (! append some text to a text file:
	var ok = plugins.file.copyFolder("stories", "stories_copy"))
	application.output("Folder copy failed.");
// Copy folder based on JSFile instances.
var d = plugins.file.createFile("stories");
var dcopy = plugins.file.createFile("stories_copy_2");
if (!plugins.file.copyFolder(d, dcopy))
	application.output("Folder copy failed.");
{appendToTXTFile('myTextFile.txt', '\nMy fantastic new line of text\n');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=createFileconvertToJSFile|class=node}{tr:id=name}{td}h6.createFileconvertToJSFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}createFileconvertToJSFile{span}{span:id=iets|style=float: left;}\(targetFilefile){span}{td}{tr}{tr:id=des}{td}{sub-section:createFileconvertToJSFile_des|text=|trigger=button}{sub-section}{sub-section:createFileconvertToJSFile_des|trigger=none|class=sIndent}CreatesReturns a JSFile instance. Does not create the file on disk corresponding to an alternative representation of a file (for example a string).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:createFileconvertToJSFile_snc|text=|trigger=button}{sub-section}{sub-section:createFileconvertToJSFile_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:createFileconvertToJSFile_prs|text=|trigger=button}{sub-section}{sub-section:createFileconvertToJSFile_prs|trigger=none|class=sIndent}targetFile}\{[Object]} file
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:createFileconvertToJSFile_ret|text=|trigger=button}{sub-section}{sub-section:createFileconvertToJSFile_ret|trigger=none|class=sIndent}[JSFile] -- JSFile{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:createFileconvertToJSFile_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createFileconvertToJSFile_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:createFileconvertToJSFile_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createFileconvertToJSFile_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:createFileconvertToJSFile_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createFileconvertToJSFile_sam|trigger=none}{code:language=javascript}
// Create the JSFile instance based on the file name.
var f = plugins.file.createFileconvertToJSFile("newfilestory.txt");
// Create the file on disk.
if (!f.createNewFilecanRead())
	application.output("TheFile filecan could not be createdread.");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=createFolderconvertToRemoteJSFile|class=node}{tr:id=name}{td}h6.createFolderconvertToRemoteJSFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[BooleanJSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}createFolderconvertToRemoteJSFile{span}{span:id=iets|style=float: left;}\(targetFolderpath){span}{td}{tr}{tr:id=des}{td}{sub-section:createFolderconvertToRemoteJSFile_des|text=|trigger=button}{sub-section}{sub-section:createFolderconvertToRemoteJSFile_des|trigger=none|class=sIndent}CreatesConvenience areturn folderto onget disk.a ReturnsJSFile truerepresentation ifof thea folderserver isfile successfullybased created,on false if any error occursits path.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:createFolderconvertToRemoteJSFile_snc|text=|trigger=button}{sub-section}{sub-section:createFolderconvertToRemoteJSFile_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:createFolderconvertToRemoteJSFile_prs|text=|trigger=button}{sub-section}{sub-section:createFolderconvertToRemoteJSFile_prs|trigger=none|class=sIndent}targetFolder}\{[String]} path -- the path representing a file on the server (should start with "/")
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:createFolderconvertToRemoteJSFile_ret|text=|trigger=button}{sub-section}{sub-section:createFolderconvertToRemoteJSFile_ret|trigger=none|class=sIndent}[Boolean]JSFile] -- the JSFile{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:createFolderconvertToRemoteJSFile_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createFolderconvertToRemoteJSFile_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:createFolderconvertToRemoteJSFile_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createFolderconvertToRemoteJSFile_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:createFolderconvertToRemoteJSFile_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createFolderconvertToRemoteJSFile_sam|trigger=none}{code:language=javascript}
var df = plugins.file.convertToJSFile("newfolder"convertToRemoteJSFile('/story.txt');
if (!plugins.file.createFolder(df && f.canRead())
	application.output("Folder could not'File can be createdread."');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=createTempFilecopyFile|class=node}{tr:id=name}{td}h6.createTempFilecopyFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFileBoolean]{span}{span:id=iets|style=float: left; font-weight: bold;}createTempFilecopyFile{span}{span:id=iets|style=float: left;}\(filePrefixsource, fileSuffixdestination){span}{td}{tr}{tr:id=des}{td}{sub-section:createTempFilecopyFile_des|text=|trigger=button}{sub-section}{sub-section:createTempFilecopyFile_des|trigger=none|class=sIndent}CreatesCopies athe temporarysource file onto disk.the Adestination prefixfile. andReturns antrue extensionif arethe specifiedcopy andsucceeds, theyfalse willif beany part of the file nameerror occurs.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:createTempFilecopyFile_snc|text=|trigger=button}{sub-section}{sub-section:createTempFilecopyFile_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:createTempFilecopyFile_prs|text=|trigger=button}{sub-section}{sub-section:createTempFilecopyFile_prs|trigger=none|class=sIndent}filePrefix
fileSuffix}\{[Object]} source
\{[Object]} destination
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:createTempFilecopyFile_ret|text=|trigger=button}{sub-section}{sub-section:createTempFilecopyFile_ret|trigger=none|class=sIndent}[JSFileBoolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:createTempFilecopyFile_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createTempFilecopyFile_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:createTempFilecopyFile_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createTempFilecopyFile_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:createTempFilecopyFile_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createTempFilecopyFile_sam|trigger=none}{code:language=javascript}
var tempFile = 
// Copy based on file names.
if (!plugins.file.createTempFile('myfile','.txt');
application.output('Temporary file created as: ' + tempFile.getAbsolutePath());
plugins.file.writeTXTFile(tempFile, 'abcdefg'copyFile("story.txt", "story.txt.copy"))
	application.output("Copy failed.");
// Copy based on JSFile instances.
var f = plugins.file.createFile("story.txt");
var fcopy = plugins.file.createFile("story.txt.copy2");
if (!plugins.file.copyFile(f, fcopy))
	application.output("Copy failed.");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=deleteFilecopyFolder|class=node}{tr:id=name}{td}h6.deleteFilecopyFolder{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}deleteFilecopyFolder{span}{span:id=iets|style=float: left;}\(targetFilesource, destination){span}{td}{tr}{tr:id=des}{td}{sub-section:deleteFilecopyFolder_des|text=|trigger=button}{sub-section}{sub-section:deleteFilecopyFolder_des|trigger=none|class=sIndent}Removes a file from diskCopies the sourcefolder to the destination folder, recursively. Returns true if onthe copy successsucceeds, false otherwise if any error occurs.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:deleteFilecopyFolder_snc|text=|trigger=button}{sub-section}{sub-section:deleteFilecopyFolder_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:deleteFilecopyFolder_prs|text=|trigger=button}{sub-section}{sub-section:deleteFilecopyFolder_prs|trigger=none|class=sIndent}targetFile}\{[Object]} source
\{[Object]} destination
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:deleteFilecopyFolder_ret|text=|trigger=button}{sub-section}{sub-section:deleteFilecopyFolder_ret|trigger=none|class=sIndent}[Boolean] -- success boolean{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:deleteFilecopyFolder_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteFilecopyFolder_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:deleteFilecopyFolder_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteFilecopyFolder_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:deleteFilecopyFolder_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteFilecopyFolder_sam|trigger=none}{code:language=javascript}
// Copy folder based on names.
if (!plugins.file.copyFolder("stories", "stories_copy"))
	application.output("Folder copy failed.");
// Copy folder based on JSFile instances.
var d = plugins.file.createFile("stories");
var dcopy = plugins.file.deleteFile('story.txt'createFile("stories_copy_2");
if (!plugins.file.copyFolder(d, dcopy))
	application.output('File deleted.'"Folder copy failed.");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=deleteFoldercreateFile|class=node}{tr:id=name}{td}h6.deleteFoldercreateFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[BooleanJSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}deleteFoldercreateFile{span}{span:id=iets|style=float: left;}\(targetFolder, showWarningtargetFile){span}{td}{tr}{tr:id=des}{td}{sub-section:deleteFoldercreateFile_des|text=|trigger=button}{sub-section}{sub-section:deleteFoldercreateFile_des|trigger=none|class=sIndent}DeletesCreates a folder from disk recursivelyJSFile instance. ReturnsDoes truenot on success, false otherwise. If create the secondfile parameter is set to true, then a warning will be issued to the user before actually removing the folderon disk.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:deleteFoldercreateFile_snc|text=|trigger=button}{sub-section}{sub-section:deleteFoldercreateFile_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:deleteFoldercreateFile_prs|text=|trigger=button}{sub-section}{sub-section:deleteFoldercreateFile_prs|trigger=none|class=sIndent}\{[Object]}targetFolder showWarningtargetFile
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:deleteFoldercreateFile_ret|text=|trigger=button}{sub-section}{sub-section:deleteFoldercreateFile_ret|trigger=none|class=sIndent}[BooleanJSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:deleteFoldercreateFile_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteFoldercreateFile_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:deleteFoldercreateFile_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteFoldercreateFile_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:deleteFoldercreateFile_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteFoldercreateFile_sam|trigger=none}{code:language=javascript}
if (
// Create the JSFile instance based on the file name.
var f = plugins.file.deleteFolder('stories', truecreateFile("newfile.txt");
// Create the file on disk.
if (!f.createNewFile())
	application.output('Folder deleted.'"The file could not be created.");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getDefaultUploadLocationcreateFolder|class=node}{tr:id=name}{td}h6.getDefaultUploadLocationcreateFolder{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[StringBoolean]{span}{span:id=iets|style=float: left; font-weight: bold;}getDefaultUploadLocationcreateFolder{span}{span:id=iets|style=float: left;}\(destination){span}{td}{tr}{tr:id=des}{td}{sub-section:getDefaultUploadLocationcreateFolder_des|text=|trigger=button}{sub-section}{sub-section:getDefaultUploadLocationcreateFolder_des|trigger=none|class=sIndent}Creates a folder on disk. Returns true if the folder is defaultsuccessfully uploadcreated, locationfalse pathif ofany theerror serveroccurs.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getDefaultUploadLocationcreateFolder_snc|text=|trigger=button}{sub-section}{sub-section:getDefaultUploadLocationcreateFolder_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getDefaultUploadLocationcreateFolder_prs|text=|trigger=button}{sub-section}{sub-section:getDefaultUploadLocationcreateFolder_prs|trigger=none|class=sIndent}{sub\{[Object]} destination
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getDefaultUploadLocationcreateFolder_ret|text=|trigger=button}{sub-section}{sub-section:getDefaultUploadLocationcreateFolder_ret|trigger=none|class=sIndent}[StringBoolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getDefaultUploadLocationcreateFolder_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getDefaultUploadLocationcreateFolder_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getDefaultUploadLocationcreateFolder_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getDefaultUploadLocationcreateFolder_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getDefaultUploadLocationcreateFolder_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getDefaultUploadLocationcreateFolder_sam|trigger=none}{code:language=javascript}
//var getd the= (server-side) default upload location path:
	var serverPath = plugins.file.getDefaultUploadLocation(plugins.file.convertToJSFile("newfolder");
if (!plugins.file.createFolder(d))
	application.output("Folder could not be created.");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getDesktopFoldercreateTempFile|class=node}{tr:id=name}{td}h6.getDesktopFoldercreateTempFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}getDesktopFoldercreateTempFile{span}{span:id=iets|style=float: left;}\(prefix, suffix){span}{td}{tr}{tr:id=des}{td}{sub-section:getDesktopFoldercreateTempFile_des|text=|trigger=button}{sub-section}{sub-section:getDesktopFoldercreateTempFile_des|trigger=none|class=sIndent}ReturnsCreates a JSFile instance that corresponds to the Desktop folder temporary file on disk. A prefix and an extension are specified and they will be part of the currently logged in userfile name.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getDesktopFoldercreateTempFile_snc|text=|trigger=button}{sub-section}{sub-section:getDesktopFoldercreateTempFile_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getDesktopFoldercreateTempFile_prs|text=|trigger=button}{sub-section}{sub-section:getDesktopFoldercreateTempFile_prs|trigger=none|class=sIndent}\{[String]} prefix
\{[String]} suffix
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getDesktopFoldercreateTempFile_ret|text=|trigger=button}{sub-section}{sub-section:getDesktopFoldercreateTempFile_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getDesktopFoldercreateTempFile_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getDesktopFoldercreateTempFile_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getDesktopFoldercreateTempFile_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getDesktopFoldercreateTempFile_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getDesktopFoldercreateTempFile_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getDesktopFoldercreateTempFile_sam|trigger=none}{code:language=javascript}
var dtempFile = plugins.file.getDesktopFolder(createTempFile('myfile','.txt');
application.output('desktopTemporary file foldercreated isas: ' + dtempFile.getAbsolutePath());
plugins.file.writeTXTFile(tempFile, 'abcdefg');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getDiskListdeleteFile|class=node}{tr:id=name}{td}h6.getDiskListdeleteFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}getDiskListdeleteFile{span}{span:id=iets|style=float: left;}\(destination){span}{td}{tr}{tr:id=des}{td}{sub-section:getDiskListdeleteFile_des|text=|trigger=button}{sub-section}{sub-section:getDiskListdeleteFile_des|trigger=none|class=sIndent}ReturnsRemoves ana Arrayfile offrom JSFiledisk. instancesReturns correpondingtrue toon thesuccess, file system root foldersfalse otherwise.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getDiskListdeleteFile_snc|text=|trigger=button}{sub-section}{sub-section:getDiskListdeleteFile_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getDiskListdeleteFile_prs|text=|trigger=button}{sub-section}{sub-section:getDiskListdeleteFile_prs|trigger=none|class=sIndent}\{[Object]} destination
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getDiskListdeleteFile_ret|text=|trigger=button}{sub-section}{sub-section:getDiskListdeleteFile_ret|trigger=none|class=sIndent}[JSFileBoolean]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getDiskListdeleteFile_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getDiskListdeleteFile_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getDiskListdeleteFile_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getDiskListdeleteFile_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getDiskListdeleteFile_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getDiskListdeleteFile_sam|trigger=none}{code:language=javascript}
var roots = if (plugins.file.getDiskListdeleteFile();
for (var i = 0; i < roots.length; i++'story.txt'))
	application.output(roots[i].getAbsolutePath())'File deleted.');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getFileSizedeleteFolder|class=node}{tr:id=name}{td}h6.getFileSizedeleteFolder{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[NumberBoolean]{span}{span:id=iets|style=float: left; font-weight: bold;}getFileSizedeleteFolder{span}{span:id=iets|style=float: left;}\(targetFiledestination, showWarning){span}{td}{tr}{tr:id=des}{td}{sub-section:getFileSizedeleteFolder_des|text=|trigger=button}{sub-section}{sub-section:getFileSizedeleteFolder_des|trigger=none|class=sIndent}Deletes a folder from disk recursively. Returns true on success, false otherwise. If the sizesecond ofparameter theis specified file.{sub-sectionset to true, then a warning will be issued to the user before actually removing the folder.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getFileSizedeleteFolder_snc|text=|trigger=button}{sub-section}{sub-section:getFileSizedeleteFolder_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getFileSizedeleteFolder_prs|text=|trigger=button}{sub-section}{sub-section:getFileSizedeleteFolder_prs|trigger=none|class=sIndent}targetFile}\{[Object]} destination
\{[Boolean]} showWarning
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getFileSizedeleteFolder_ret|text=|trigger=button}{sub-section}{sub-section:getFileSizedeleteFolder_ret|trigger=none|class=sIndent}[NumberBoolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getFileSizedeleteFolder_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getFileSizedeleteFolder_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getFileSizedeleteFolder_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getFileSizedeleteFolder_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getFileSizedeleteFolder_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getFileSizedeleteFolder_sam|trigger=none}{code:language=javascript}
var f = if (plugins.file.convertToJSFiledeleteFolder('story.txt');
stories', true))
	application.output('file size: ' + plugins.file.getFileSize(f)Folder deleted.');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getFolderContentsgetDefaultUploadLocation|class=node}{tr:id=name}{td}h6.getFolderContentsgetDefaultUploadLocation{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getFolderContentsgetDefaultUploadLocation{span}{span:id=iets|style=float: left;}\(targetFolder, \[fileFilter\], \[fileOption(1=files,2=dirs)\], \[visibleOption(1=visible,2=nonvisible)\], \[lockedOption(1=locked,2=nonlocked)\]){span}{td}{tr}{tr:id=des}{td}{sub-section:getFolderContentsgetDefaultUploadLocation_des|text=|trigger=button}{sub-section}{sub-section:getFolderContentsgetDefaultUploadLocation_des|trigger=none|class=sIndent}Returns anthe arraydefault ofupload JSFile instances corresponding to contentlocation path of the specified folder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.{sub-section}{td}{server.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getFolderContentsgetDefaultUploadLocation_snc|text=|trigger=button}{sub-section}{sub-section:getFolderContentsgetDefaultUploadLocation_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getFolderContentsgetDefaultUploadLocation_prs|text=|trigger=button}{sub-section}{sub-section:getFolderContentsgetDefaultUploadLocation_prs|trigger=none|class=sIndent}targetFolder
\[fileFilter\]
\[fileOption(1=files,2=dirs)\]
\[visibleOption(1=visible,2=nonvisible)\]
\[lockedOption(1=locked,2=nonlocked)\]
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getFolderContentsgetDefaultUploadLocation_ret|text=|trigger=button}{sub-section}{sub-section:getFolderContentsgetDefaultUploadLocation_ret|trigger=none|class=sIndent}[JSFile]\[]String] -- the location as canonical path{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getFolderContentsgetDefaultUploadLocation_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getFolderContentsgetDefaultUploadLocation_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getFolderContentsgetDefaultUploadLocation_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getFolderContentsgetDefaultUploadLocation_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getFolderContentsgetDefaultUploadLocation_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getFolderContentsgetDefaultUploadLocation_sam|trigger=none}{code:language=javascript}
var// filesget =the plugins.file.getFolderContents('stories', '.txt');
for (var i=0; i<files.length; i++)
	application.output(files[i].getAbsolutePath())(server-side) default upload location path:
var serverPath = plugins.file.getDefaultUploadLocation();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getHomeFoldergetDesktopFolder|class=node}{tr:id=name}{td}h6.getHomeFoldergetDesktopFolder{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}getHomeFoldergetDesktopFolder{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getHomeFoldergetDesktopFolder_des|text=|trigger=button}{sub-section}{sub-section:getHomeFoldergetDesktopFolder_des|trigger=none|class=sIndent}Returns a JSFile instance that correspondingcorresponds to the homeDesktop folder of the currently logged in useduser.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getHomeFoldergetDesktopFolder_snc|text=|trigger=button}{sub-section}{sub-section:getHomeFoldergetDesktopFolder_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getHomeFoldergetDesktopFolder_prs|text=|trigger=button}{sub-section}{sub-section:getHomeFoldergetDesktopFolder_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getHomeFoldergetDesktopFolder_ret|text=|trigger=button}{sub-section}{sub-section:getHomeFoldergetDesktopFolder_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getHomeFoldergetDesktopFolder_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getHomeFoldergetDesktopFolder_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getHomeFoldergetDesktopFolder_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getHomeFoldergetDesktopFolder_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getHomeFoldergetDesktopFolder_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getHomeFoldergetDesktopFolder_sam|trigger=none}{code:language=javascript}
var d = plugins.file.getHomeFoldergetDesktopFolder();
application.output('homedesktop folder is: ' + d.getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getModificationDategetDiskList|class=node}{tr:id=name}{td}h6.getModificationDategetDiskList{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[Date]{span}{span:id=iets|style=float: left; font-weight: bold;}getModificationDategetDiskList{span}{span:id=iets|style=float: left;}\(targetFile){span}{td}{tr}{tr:id=des}{td}{sub-section:getModificationDategetDiskList_des|text=|trigger=button}{sub-section}{sub-section:getModificationDategetDiskList_des|trigger=none|class=sIndent}Returns the modification date of a file an Array of JSFile instances correponding to the file system root folders.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getModificationDategetDiskList_snc|text=|trigger=button}{sub-section}{sub-section:getModificationDategetDiskList_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getModificationDategetDiskList_prs|text=|trigger=button}{sub-section}{sub-section:getModificationDategetDiskList_prs|trigger=none|class=sIndent}targetFile
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getModificationDategetDiskList_ret|text=|trigger=button}{sub-section}{sub-section:getModificationDategetDiskList_ret|trigger=none|class=sIndent}[JSFile]\[Date]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getModificationDategetDiskList_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getModificationDategetDiskList_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getModificationDategetDiskList_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getModificationDategetDiskList_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getModificationDategetDiskList_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getModificationDategetDiskList_sam|trigger=none}{code:language=javascript}
var froots = plugins.file.convertToJSFilegetDiskList('story.txt');
for application.output('last changed: ' + plugins.file.getModificationDate(f(var i = 0; i < roots.length; i++)
	application.output(roots[i].getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getRemoteFolderContentsgetFileSize|class=node}{tr:id=name}{td}h6.getRemoteFolderContentsgetFileSize{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getRemoteFolderContentsgetFileSize{span}{span:id=iets|style=float: left;}\(targetFolder, \[fileFilter\], \[fileOption(1=files,2=dirs)\], \[visibleOption(1=visible,2=nonvisible)\], \[lockedOption(1=locked,2=nonlocked)\]){span}{td}{tr}{trpath){span}{td}{tr}{tr:id=des}{td}{sub-section:getRemoteFolderContentsgetFileSize_des|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContentsgetFileSize_des|trigger=none|class=sIndent}Returns anthe arraysize of JSFile instances corresponding to content of the specified folder on the server side. The content can be filtered by optional name filter(s), by type, by visibility and by lock statusfile.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getRemoteFolderContentsgetFileSize_snc|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContentsgetFileSize_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getRemoteFolderContentsgetFileSize_prs|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContentsgetFileSize_prs|trigger=none|class=sIndent}targetFolder
\{[fileFilter\Object]
\[fileOption(1=files,2=dirs)\]
\[visibleOption(1=visible,2=nonvisible)\]
\[lockedOption(1=locked,2=nonlocked)\]
} path
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getRemoteFolderContentsgetFileSize_ret|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContentsgetFileSize_ret|trigger=none|class=sIndent}[JSFile]\[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getRemoteFolderContentsgetFileSize_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContentsgetFileSize_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getRemoteFolderContentsgetFileSize_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContentsgetFileSize_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getRemoteFolderContentsgetFileSize_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContentsgetFileSize_sam|trigger=none}{code:language=javascript}
//var retrievesf an array of files located on the server side inside the default upload folder:
	var files == plugins.file.convertToJSFile('story.txt');
application.output('file size: ' + plugins.file.getRemoteFolderContents('/', '.txt'getFileSize(f));
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=moveFilegetFolderContents-Object|class=node}{tr:id=name}{td}h6.moveFilegetFolderContents{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}moveFilegetFolderContents{span}{span:id=iets|style=float: left;}\(sourceFile, destinationFiletargetFolder){span}{td}{tr}{tr:id=des}{td}{sub-section:moveFilegetFolderContents-Object_des|text=|trigger=button}{sub-section}{sub-section:moveFilegetFolderContents-Object_des|trigger=none|class=sIndent}MovesReturns an thearray fileof fromJSFile theinstances sourcecorresponding to content of the destinationspecified place. Returns true on success, false otherwisefolder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:moveFilegetFolderContents-Object_snc|text=|trigger=button}{sub-section}{sub-section:moveFilegetFolderContents-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:moveFilegetFolderContents-Object_prs|text=|trigger=button}{sub-section}{sub-section:moveFilegetFolderContents-Object_prs|trigger=none|class=sIndent}sourceFile
destinationFile}\{[Object]} targetFolder -- File or path object.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:moveFilegetFolderContents-Object_ret|text=|trigger=button}{sub-section}{sub-section:moveFilegetFolderContents-Object_ret|trigger=none|class=sIndent}[JSFile]\[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:moveFilegetFolderContents-Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:moveFilegetFolderContents-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:moveFilegetFolderContents-Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:moveFilegetFolderContents-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:moveFilegetFolderContents-Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:moveFilegetFolderContents-Object_sam|trigger=none}{code:language=javascript}
//var Movefiles file based on names.
if (!= plugins.file.moveFilegetFolderContents('story.txtstories', 'story.txt.new'))
	application.output('File move failed.');
// Move file based on JSFile instances.
var f = plugins.file.convertToJSFile('story.txt.new');
var fmoved = plugins.file.convertToJSFile('story.txt');
if (!plugins.file.moveFile(f, fmoved))for (var i=0; i<files.length; i++)
	application.output('File move back failed.'files[i].getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readFilegetFolderContents-Object_Object|class=node}{tr:id=name}{td}h6.readFilegetFolderContents{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[JSFile]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}readFilegetFolderContents{span}{span:id=iets|style=float: left;}\(\[file\]targetFolder, \[size\]fileFilter){span}{td}{tr}{tr:id=des}{td}{sub-section:readFilegetFolderContents-Object_Object_des|text=|trigger=button}{sub-section}{sub-section:readFilegetFolderContents-Object_Object_des|trigger=none|class=sIndent}Reads all or part of theReturns an array of JSFile instances corresponding to content fromof athe binaryspecified filefolder. IfThe acontent filecan namebe isfiltered notby specified,optional then a file selection dialog pops up for selecting a file. (Web Enabled only for a JSFile argument){subname filter(s), by type, by visibility and by lock status.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readFilegetFolderContents-Object_Object_snc|text=|trigger=button}{sub-section}{sub-section:readFilegetFolderContents-Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:readFilegetFolderContents-Object_Object_prs|text=|trigger=button}{sub-section}{sub-section:readFilegetFolderContents-Object_Object_prs|trigger=none|class=sIndent}\{[file\]
\[size\]
Object]} targetFolder -- File or path object.
\{[Object]} fileFilter -- Filter or array of filters for files in folder.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:readFilegetFolderContents-Object_Object_ret|text=|trigger=button}{sub-section}{sub-section:readFilegetFolderContents-Object_Object_ret|trigger=none|class=sIndent}byte[JSFile]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readFilegetFolderContents-Object_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readFilegetFolderContents-Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readFilegetFolderContents-Object_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readFilegetFolderContents-Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readFilegetFolderContents-Object_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readFilegetFolderContents-Object_Object_sam|trigger=none}{code:language=javascript}
// Read all content from the file.
var bytesfiles = plugins.file.readFilegetFolderContents('stories'big, '.jpgtxt');
for application.output('file size: ' + bytes.length);
// Read only the first 1KB from the file.
var bytesPartial = plugins.file.readFile('big.jpg', 1024);
application.output('partial file size: ' + bytesPartial.length);
// Read all content from a file selected from the file open dialog.
var bytesUnknownFile = plugins.file.readFile();
application.output('unknown file size: ' + bytesUnknownFile.length);
{code}{sub-section}{var i=0; i<files.length; i++)
	application.output(files[i].getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readTXTFilegetFolderContents-Object_Object_Number|class=node}{tr:id=name}{td}h6.readTXTFilegetFolderContents{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[StringJSFile]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}readTXTFilegetFolderContents{span}{span:id=iets|style=float: left;}\(\[file\], \[charsetname\]targetFolder, fileFilter, fileOption){span}{td}{tr}{tr:id=des}{td}{sub-section:readTXTFilegetFolderContents-Object_Object_Number_des|text=|trigger=button}{sub-section}{sub-section:readTXTFilegetFolderContents-Object_Object_Number_des|trigger=none|class=sIndent}ReadReturns allan contentarray fromof aJSFile textinstances file.corresponding Ifto acontent fileof namethe isspecified notfolder. specified,The thencontent acan filebe selectionfiltered dialogby popsoptional up for selecting a file. The encoding can be also specified. (Web Enabled only for a JSFile argument)name filter(s), by type, by visibility and by lock status.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readTXTFilegetFolderContents-Object_Object_Number_snc|text=|trigger=button}{sub-section}{sub-section:readTXTFilegetFolderContents-Object_Object_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:readTXTFilegetFolderContents-Object_Object_Number_prs|text=|trigger=button}{sub-section}{sub-section:readTXTFilegetFolderContents-Object_Object_Number_prs|trigger=none|class=sIndent}\[file\]
\[charsetname\]{[Object]} targetFolder -- File or path object.
\{[Object]} fileFilter -- Filter or array of filters for files in folder.
\{[Number]} fileOption -- 1=files, 2=dirs
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:readTXTFilegetFolderContents-Object_Object_Number_ret|text=|trigger=button}{sub-section}{sub-section:readTXTFilegetFolderContents-Object_Object_Number_ret|trigger=none|class=sIndent}[JSFile]\[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readTXTFilegetFolderContents-Object_Object_Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readTXTFilegetFolderContents-Object_Object_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readTXTFilegetFolderContents-Object_Object_Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readTXTFilegetFolderContents-Object_Object_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readTXTFilegetFolderContents-Object_Object_Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readTXTFilegetFolderContents-Object_Object_Number_sam|trigger=none}{code:language=javascript}
//var Readfiles content from a known text file.
var txt = plugins.file.readTXTFile('story.txt');
application.output(txt);
// Read content from a text file selected from the file open dialog.
var txtUnknown = plugins.file.readTXTFile();
application.output(txtUnknown= plugins.file.getFolderContents('stories', '.txt');
for (var i=0; i<files.length; i++)
	application.output(files[i].getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number|class=node}{tr:id=name}{td}h6.showDirectorySelectDialoggetFolderContents{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}showDirectorySelectDialoggetFolderContents{span}{span:id=iets|style=float: left;}\(\[directory suggestion\], \[dialog title text\]targetFolder, fileFilter, fileOption, visibleOption){span}{td}{tr}{tr:id=des}{td}{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_des|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_des|trigger=none|class=sIndent}Shows a directory selector dialogReturns an array of JSFile instances corresponding to content of the specified folder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_snc|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_prs|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_prs|trigger=none|class=sIndent}\[directory suggestion\]
\[dialog title text\]{[Object]} targetFolder -- File or path object.
\{[Object]} fileFilter -- Filter or array of filters for files in folder.
\{[Number]} fileOption -- 1=files, 2=dirs
\{[Number]} visibleOption -- 1=visible, 2=nonvisible
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_ret|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_ret|trigger=none|class=sIndent}[JSFile]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showDirectorySelectDialoggetFolderContents-Object_Object_Number_Number_sam|trigger=none}{code:language=javascript}
var dirfiles = plugins.file.showDirectorySelectDialog();
application.output("you've selected folder: " + dirgetFolderContents('stories', '.txt');
for (var i=0; i<files.length; i++)
	application.output(files[i].getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number|class=node}{tr:id=name}{td}h6.showFileOpenDialoggetFolderContents{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileOpenDialoggetFolderContents{span}{span:id=iets|style=float: left;}\(\[selectionMode(0=both,1=Files,2=Dirs)\], \[startDirectory(null=default/previous)\], \[multiselect(true/false)\], \[filterarray\], \[callbackmethod\], \[dialog title text\]targetFolder, fileFilter, fileOption, visibleOption, lockedOption){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number_des|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number_des|trigger=none|class=sIndent}ShowsReturns an aarray fileof openJSFile dialog.instances Filterscorresponding canto becontent appliedof onthe whatspecified typefolder. ofThe filescontent can be selected.filtered (Webby Enabled,optional you must set the callback method for this to work)name filter(s), by type, by visibility and by lock status.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number_snc|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog_sncgetFolderContents-Object_Object_Number_Number_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number_prs|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number_prs|trigger=none|class=sIndent}\[selectionMode(0=both,1=Files,2=Dirs)\]
\[startDirectory(null=default/previous)\]
\[multiselect(true/false)\]
\[filterarray\]
\[callbackmethod\]
\[dialog title text\]{[Object]} targetFolder -- File or path object.
\{[Object]} fileFilter -- Filter or array of filters for files in folder.
\{[Number]} fileOption -- 1=files, 2=dirs
\{[Number]} visibleOption -- 1=visible, 2=nonvisible
\{[Number]} lockedOption -- 1=locked, 2=nonlocked
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number_ret|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number_ret|trigger=none|class=sIndent}[ObjectJSFile]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialoggetFolderContents-Object_Object_Number_Number_Number_sam|trigger=none}{code:language=javascript}
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and
// the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")').
/** @type {JSFile} */
var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif"));
application.output('File: ' + f.getName());
application.output('is dir: ' + f.isDirectory());
application.output('is file: ' + f.isFile());
application.output('path: ' + f.getAbsolutePath());

// This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc.
/** @type {JSFile[]} */
var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif"));
for (var i = 0; i < files.length; i++)
{
	 application.output('File: ' + files[i].getName());
	 application.output('content type: ' + files[i].getContentType());
	 application.output('last modified: ' + files[i].lastModified());
	 application.output('size: ' + files[i].size());
}
//for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), other options can be set but are not used in the webclient (yet)
var file = plugins.file.showFileOpenDialog(myCallbackMethod)var files = plugins.file.getFolderContents('stories', '.txt');
for (var i=0; i<files.length; i++)
	application.output(files[i].getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getHomeFolder|class=node}{tr:id=name}{td}h6.getHomeFolder{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}getHomeFolder{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getHomeFolder_des|text=|trigger=button}{sub-section}{sub-section:getHomeFolder_des|trigger=none|class=sIndent}Returns a JSFile instance corresponding to the home folder of the logged in used.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getHomeFolder_snc|text=|trigger=button}{sub-section}{sub-section:getHomeFolder_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getHomeFolder_prs|text=|trigger=button}{sub-section}{sub-section:getHomeFolder_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getHomeFolder_ret|text=|trigger=button}{sub-section}{sub-section:getHomeFolder_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getHomeFolder_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getHomeFolder_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getHomeFolder_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getHomeFolder_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getHomeFolder_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getHomeFolder_sam|trigger=none}{code:language=javascript}
var d = plugins.file.getHomeFolder();
application.output('home folder: ' + d.getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getModificationDate|class=node}{tr:id=name}{td}h6.getModificationDate{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Date]{span}{span:id=iets|style=float: left; font-weight: bold;}getModificationDate{span}{span:id=iets|style=float: left;}\(path){span}{td}{tr}{tr:id=des}{td}{sub-section:getModificationDate_des|text=|trigger=button}{sub-section}{sub-section:getModificationDate_des|trigger=none|class=sIndent}Returns the modification date of a file.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getModificationDate_snc|text=|trigger=button}{sub-section}{sub-section:getModificationDate_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getModificationDate_prs|text=|trigger=button}{sub-section}{sub-section:getModificationDate_prs|trigger=none|class=sIndent}\{[Object]} path
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getModificationDate_ret|text=|trigger=button}{sub-section}{sub-section:getModificationDate_ret|trigger=none|class=sIndent}[Date]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getModificationDate_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getModificationDate_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getModificationDate_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getModificationDate_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getModificationDate_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getModificationDate_sam|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('story.txt');
application.output('last changed: ' + plugins.file.getModificationDate(f));
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getRemoteFolderContents-Object|class=node}{tr:id=name}{td}h6.getRemoteFolderContents{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getRemoteFolderContents{span}{span:id=iets|style=float: left;}\(targetFolder){span}{td}{tr}{tr:id=des}{td}{sub-section:getRemoteFolderContents-Object_des|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_des|trigger=none|class=sIndent}Returns an array of JSFile instances corresponding to content of the specified folder on the server side. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getRemoteFolderContents-Object_snc|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getRemoteFolderContents-Object_prs|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_prs|trigger=none|class=sIndent}\{[Object]} targetFolder
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getRemoteFolderContents-Object_ret|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_ret|trigger=none|class=sIndent}[JSFile]\[] -- the array of file names{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getRemoteFolderContents-Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getRemoteFolderContents-Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getRemoteFolderContents-Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_sam|trigger=none}{code:language=javascript}
// retrieves an array of files located on the server side inside the default upload folder:
var files = plugins.file.getRemoteFolderContents('/', '.txt');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getRemoteFolderContents-Object_Object|class=node}{tr:id=name}{td}h6.getRemoteFolderContents{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getRemoteFolderContents{span}{span:id=iets|style=float: left;}\(targetFolder, fileFilter){span}{td}{tr}{tr:id=des}{td}{sub-section:getRemoteFolderContents-Object_Object_des|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_des|trigger=none|class=sIndent}Returns an array of JSFile instances corresponding to content of the specified folder on the server side. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getRemoteFolderContents-Object_Object_snc|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getRemoteFolderContents-Object_Object_prs|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_prs|trigger=none|class=sIndent}\{[Object]} targetFolder
\{[Object]} fileFilter
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getRemoteFolderContents-Object_Object_ret|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_ret|trigger=none|class=sIndent}[JSFile]\[] -- the array of file names{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getRemoteFolderContents-Object_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getRemoteFolderContents-Object_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getRemoteFolderContents-Object_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_Object_sam|trigger=none}{code:language=javascript}
// retrieves an array of files located on the server side inside the default upload folder:
var files = plugins.file.getRemoteFolderContents('/', '.txt');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getRemoteFolderContents-Object_Object_Number|class=node}{tr:id=name}{td}h6.getRemoteFolderContents{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getRemoteFolderContents{span}{span:id=iets|style=float: left;}\(targetFolder, fileFilter, fileOption){span}{td}{tr}{tr:id=des}{td}{sub-section:getRemoteFolderContents-Object_Object_Number_des|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_Number_des|trigger=none|class=sIndent}Returns an array of JSFile instances corresponding to content of the specified folder on the server side. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getRemoteFolderContents-Object_Object_Number_snc|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getRemoteFolderContents-Object_Object_Number_prs|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_Number_prs|trigger=none|class=sIndent}\{[Object]} targetFolder
\{[Object]} fileFilter
\{[Number]} fileOption
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getRemoteFolderContents-Object_Object_Number_ret|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_Number_ret|trigger=none|class=sIndent}[JSFile]\[] -- the array of file names{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getRemoteFolderContents-Object_Object_Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_Object_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getRemoteFolderContents-Object_Object_Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_Object_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getRemoteFolderContents-Object_Object_Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_Object_Number_sam|trigger=none}{code:language=javascript}
// retrieves an array of files located on the server side inside the default upload folder:
var files = plugins.file.getRemoteFolderContents('/', '.txt');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getRemoteFolderContents-Object_Object_Number_Number|class=node}{tr:id=name}{td}h6.getRemoteFolderContents{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getRemoteFolderContents{span}{span:id=iets|style=float: left;}\(targetFolder, fileFilter, fileOption, visibleOption){span}{td}{tr}{tr:id=des}{td}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_des|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_des|trigger=none|class=sIndent}Returns an array of JSFile instances corresponding to content of the specified folder on the server side. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getRemoteFolderContents-Object_Object_Number_Number_snc|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getRemoteFolderContents-Object_Object_Number_Number_prs|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_prs|trigger=none|class=sIndent}\{[Object]} targetFolder
\{[Object]} fileFilter
\{[Number]} fileOption
\{[Number]} visibleOption
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getRemoteFolderContents-Object_Object_Number_Number_ret|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_ret|trigger=none|class=sIndent}[JSFile]\[] -- the array of file names{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getRemoteFolderContents-Object_Object_Number_Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getRemoteFolderContents-Object_Object_Number_Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getRemoteFolderContents-Object_Object_Number_Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_sam|trigger=none}{code:language=javascript}
// retrieves an array of files located on the server side inside the default upload folder:
var files = plugins.file.getRemoteFolderContents('/', '.txt');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getRemoteFolderContents-Object_Object_Number_Number_Number|class=node}{tr:id=name}{td}h6.getRemoteFolderContents{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getRemoteFolderContents{span}{span:id=iets|style=float: left;}\(targetFolder, fileFilter, fileOption, visibleOption, lockedOption){span}{td}{tr}{tr:id=des}{td}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_des|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_des|trigger=none|class=sIndent}Returns an array of JSFile instances corresponding to content of the specified folder on the server side. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_snc|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_prs|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_prs|trigger=none|class=sIndent}\{[Object]} targetFolder
\{[Object]} fileFilter
\{[Number]} fileOption
\{[Number]} visibleOption
\{[Number]} lockedOption
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_ret|text=|trigger=button}{sub-section}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_ret|trigger=none|class=sIndent}[JSFile]\[] -- the array of file names{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRemoteFolderContents-Object_Object_Number_Number_Number_sam|trigger=none}{code:language=javascript}
// retrieves an array of files located on the server side inside the default upload folder:
var files = plugins.file.getRemoteFolderContents('/', '.txt');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=moveFile|class=node}{tr:id=name}{td}h6.moveFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}moveFile{span}{span:id=iets|style=float: left;}\(source, destination){span}{td}{tr}{tr:id=des}{td}{sub-section:moveFile_des|text=|trigger=button}{sub-section}{sub-section:moveFile_des|trigger=none|class=sIndent}Moves the file from the source to the destination place. Returns true on success, false otherwise.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:moveFile_snc|text=|trigger=button}{sub-section}{sub-section:moveFile_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:moveFile_prs|text=|trigger=button}{sub-section}{sub-section:moveFile_prs|trigger=none|class=sIndent}\{[Object]} source
\{[Object]} destination
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:moveFile_ret|text=|trigger=button}{sub-section}{sub-section:moveFile_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:moveFile_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:moveFile_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:moveFile_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:moveFile_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:moveFile_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:moveFile_sam|trigger=none}{code:language=javascript}
// Move file based on names.
if (!plugins.file.moveFile('story.txt','story.txt.new'))
	application.output('File move failed.');
// Move file based on JSFile instances.
var f = plugins.file.convertToJSFile('story.txt.new');
var fmoved = plugins.file.convertToJSFile('story.txt');
if (!plugins.file.moveFile(f, fmoved))
	application.output('File move back failed.');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readFile|class=node}{tr:id=name}{td}h6.readFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}readFile{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:readFile_des|text=|trigger=button}{sub-section}{sub-section:readFile_des|trigger=none|class=sIndent}Reads all or part of the content from a binary file. If a file name is not specified, then a file selection dialog pops up for selecting a file. (Web Enabled only for a JSFile argument){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readFile_snc|text=|trigger=button}{sub-section}{sub-section:readFile_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:readFile_prs|text=|trigger=button}{sub-section}{sub-section:readFile_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:readFile_ret|text=|trigger=button}{sub-section}{sub-section:readFile_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readFile_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readFile_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readFile_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readFile_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readFile_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readFile_sam|trigger=none}{code:language=javascript}
// Read all content from the file.
var bytes = plugins.file.readFile('big.jpg');
application.output('file size: ' + bytes.length);
// Read only the first 1KB from the file.
var bytesPartial = plugins.file.readFile('big.jpg', 1024);
application.output('partial file size: ' + bytesPartial.length);
// Read all content from a file selected from the file open dialog.
var bytesUnknownFile = plugins.file.readFile();
application.output('unknown file size: ' + bytesUnknownFile.length);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readFile-Object|class=node}{tr:id=name}{td}h6.readFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}readFile{span}{span:id=iets|style=float: left;}\(file){span}{td}{tr}{tr:id=des}{td}{sub-section:readFile-Object_des|text=|trigger=button}{sub-section}{sub-section:readFile-Object_des|trigger=none|class=sIndent}Reads all or part of the content from a binary file. If a file name is not specified, then a file selection dialog pops up for selecting a file. (Web Enabled only for a JSFile argument){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readFile-Object_snc|text=|trigger=button}{sub-section}{sub-section:readFile-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:readFile-Object_prs|text=|trigger=button}{sub-section}{sub-section:readFile-Object_prs|trigger=none|class=sIndent}\{[Object]} file -- JSFile or path.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:readFile-Object_ret|text=|trigger=button}{sub-section}{sub-section:readFile-Object_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readFile-Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readFile-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readFile-Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readFile-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readFile-Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readFile-Object_sam|trigger=none}{code:language=javascript}
// Read all content from the file.
var bytes = plugins.file.readFile('big.jpg');
application.output('file size: ' + bytes.length);
// Read only the first 1KB from the file.
var bytesPartial = plugins.file.readFile('big.jpg', 1024);
application.output('partial file size: ' + bytesPartial.length);
// Read all content from a file selected from the file open dialog.
var bytesUnknownFile = plugins.file.readFile();
application.output('unknown file size: ' + bytesUnknownFile.length);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readFile-Object_Number|class=node}{tr:id=name}{td}h6.readFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}readFile{span}{span:id=iets|style=float: left;}\(file, size){span}{td}{tr}{tr:id=des}{td}{sub-section:readFile-Object_Number_des|text=|trigger=button}{sub-section}{sub-section:readFile-Object_Number_des|trigger=none|class=sIndent}Reads all or part of the content from a binary file. If a file name is not specified, then a file selection dialog pops up for selecting a file. (Web Enabled only for a JSFile argument){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readFile-Object_Number_snc|text=|trigger=button}{sub-section}{sub-section:readFile-Object_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:readFile-Object_Number_prs|text=|trigger=button}{sub-section}{sub-section:readFile-Object_Number_prs|trigger=none|class=sIndent}\{[Object]} file -- JSFile or path.
\{[Number]} size -- Number of bytes to read.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:readFile-Object_Number_ret|text=|trigger=button}{sub-section}{sub-section:readFile-Object_Number_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readFile-Object_Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readFile-Object_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readFile-Object_Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readFile-Object_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readFile-Object_Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readFile-Object_Number_sam|trigger=none}{code:language=javascript}
// Read all content from the file.
var bytes = plugins.file.readFile('big.jpg');
application.output('file size: ' + bytes.length);
// Read only the first 1KB from the file.
var bytesPartial = plugins.file.readFile('big.jpg', 1024);
application.output('partial file size: ' + bytesPartial.length);
// Read all content from a file selected from the file open dialog.
var bytesUnknownFile = plugins.file.readFile();
application.output('unknown file size: ' + bytesUnknownFile.length);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readTXTFile|class=node}{tr:id=name}{td}h6.readTXTFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}readTXTFile{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:readTXTFile_des|text=|trigger=button}{sub-section}{sub-section:readTXTFile_des|trigger=none|class=sIndent}Read all content from a text file. If a file name is not specified, then a file selection dialog pops up for selecting a file. The encoding can be also specified. (Web Enabled only for a JSFile argument){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readTXTFile_snc|text=|trigger=button}{sub-section}{sub-section:readTXTFile_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:readTXTFile_prs|text=|trigger=button}{sub-section}{sub-section:readTXTFile_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:readTXTFile_ret|text=|trigger=button}{sub-section}{sub-section:readTXTFile_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readTXTFile_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readTXTFile_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readTXTFile_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readTXTFile_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readTXTFile_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readTXTFile_sam|trigger=none}{code:language=javascript}
// Read content from a known text file.
var txt = plugins.file.readTXTFile('story.txt');
application.output(txt);
// Read content from a text file selected from the file open dialog.
var txtUnknown = plugins.file.readTXTFile();
application.output(txtUnknown);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readTXTFile-Object|class=node}{tr:id=name}{td}h6.readTXTFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}readTXTFile{span}{span:id=iets|style=float: left;}\(file){span}{td}{tr}{tr:id=des}{td}{sub-section:readTXTFile-Object_des|text=|trigger=button}{sub-section}{sub-section:readTXTFile-Object_des|trigger=none|class=sIndent}Read all content from a text file. If a file name is not specified, then a file selection dialog pops up for selecting a file. The encoding can be also specified. (Web Enabled only for a JSFile argument){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readTXTFile-Object_snc|text=|trigger=button}{sub-section}{sub-section:readTXTFile-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:readTXTFile-Object_prs|text=|trigger=button}{sub-section}{sub-section:readTXTFile-Object_prs|trigger=none|class=sIndent}\{[Object]} file -- JSFile or path.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:readTXTFile-Object_ret|text=|trigger=button}{sub-section}{sub-section:readTXTFile-Object_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readTXTFile-Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readTXTFile-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readTXTFile-Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readTXTFile-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readTXTFile-Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readTXTFile-Object_sam|trigger=none}{code:language=javascript}
// Read content from a known text file.
var txt = plugins.file.readTXTFile('story.txt');
application.output(txt);
// Read content from a text file selected from the file open dialog.
var txtUnknown = plugins.file.readTXTFile();
application.output(txtUnknown);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readTXTFile-Object_String|class=node}{tr:id=name}{td}h6.readTXTFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}readTXTFile{span}{span:id=iets|style=float: left;}\(file, charsetname){span}{td}{tr}{tr:id=des}{td}{sub-section:readTXTFile-Object_String_des|text=|trigger=button}{sub-section}{sub-section:readTXTFile-Object_String_des|trigger=none|class=sIndent}Read all content from a text file. If a file name is not specified, then a file selection dialog pops up for selecting a file. The encoding can be also specified. (Web Enabled only for a JSFile argument){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readTXTFile-Object_String_snc|text=|trigger=button}{sub-section}{sub-section:readTXTFile-Object_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:readTXTFile-Object_String_prs|text=|trigger=button}{sub-section}{sub-section:readTXTFile-Object_String_prs|trigger=none|class=sIndent}\{[Object]} file -- JSFile or path.
\{[String]} charsetname -- Charset name.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:readTXTFile-Object_String_ret|text=|trigger=button}{sub-section}{sub-section:readTXTFile-Object_String_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readTXTFile-Object_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readTXTFile-Object_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readTXTFile-Object_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readTXTFile-Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readTXTFile-Object_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:readTXTFile-Object_String_sam|trigger=none}{code:language=javascript}
// Read content from a known text file.
var txt = plugins.file.readTXTFile('story.txt');
application.output(txt);
// Read content from a text file selected from the file open dialog.
var txtUnknown = plugins.file.readTXTFile();
application.output(txtUnknown);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showDirectorySelectDialog|class=node}{tr:id=name}{td}h6.showDirectorySelectDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}showDirectorySelectDialog{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:showDirectorySelectDialog_des|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialog_des|trigger=none|class=sIndent}Shows a directory selector dialog.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showDirectorySelectDialog_snc|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialog_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:showDirectorySelectDialog_prs|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialog_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:showDirectorySelectDialog_ret|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialog_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showDirectorySelectDialog_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showDirectorySelectDialog_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showDirectorySelectDialog_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showDirectorySelectDialog_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showDirectorySelectDialog_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showDirectorySelectDialog_sam|trigger=none}{code:language=javascript}
var dir = plugins.file.showDirectorySelectDialog();
application.output("you've selected folder: " + dir.getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showDirectorySelectDialog-Object|class=node}{tr:id=name}{td}h6.showDirectorySelectDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}showDirectorySelectDialog{span}{span:id=iets|style=float: left;}\(directory){span}{td}{tr}{tr:id=des}{td}{sub-section:showDirectorySelectDialog-Object_des|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialog-Object_des|trigger=none|class=sIndent}Shows a directory selector dialog.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showDirectorySelectDialog-Object_snc|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialog-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showDirectorySelectDialog-Object_prs|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialog-Object_prs|trigger=none|class=sIndent}\{[Object]} directory -- Default directory.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showDirectorySelectDialog-Object_ret|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialog-Object_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showDirectorySelectDialog-Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showDirectorySelectDialog-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showDirectorySelectDialog-Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showDirectorySelectDialog-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showDirectorySelectDialog-Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showDirectorySelectDialog-Object_sam|trigger=none}{code:language=javascript}
var dir = plugins.file.showDirectorySelectDialog();
application.output("you've selected folder: " + dir.getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showDirectorySelectDialog-Object_String|class=node}{tr:id=name}{td}h6.showDirectorySelectDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}showDirectorySelectDialog{span}{span:id=iets|style=float: left;}\(directory, title){span}{td}{tr}{tr:id=des}{td}{sub-section:showDirectorySelectDialog-Object_String_des|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialog-Object_String_des|trigger=none|class=sIndent}Shows a directory selector dialog.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showDirectorySelectDialog-Object_String_snc|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialog-Object_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showDirectorySelectDialog-Object_String_prs|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialog-Object_String_prs|trigger=none|class=sIndent}\{[Object]} directory -- Default directory.
\{[String]} title -- Dialog title.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showDirectorySelectDialog-Object_String_ret|text=|trigger=button}{sub-section}{sub-section:showDirectorySelectDialog-Object_String_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showDirectorySelectDialog-Object_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showDirectorySelectDialog-Object_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showDirectorySelectDialog-Object_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showDirectorySelectDialog-Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showDirectorySelectDialog-Object_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showDirectorySelectDialog-Object_String_sam|trigger=none}{code:language=javascript}
var dir = plugins.file.showDirectorySelectDialog();
application.output("you've selected folder: " + dir.getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileOpenDialog|class=node}{tr:id=name}{td}h6.showFileOpenDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileOpenDialog{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileOpenDialog_des|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog_des|trigger=none|class=sIndent}Shows a file open dialog. Filters can be applied on what type of files can be selected. (Web Enabled, you must set the callback method for this to work){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileOpenDialog_snc|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileOpenDialog_prs|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:showFileOpenDialog_ret|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog_ret|trigger=none|class=sIndent}[Object]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileOpenDialog_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileOpenDialog_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileOpenDialog_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog_sam|trigger=none}{code:language=javascript}
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and
// the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")').
/** @type {JSFile} */
var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif"));
application.output('File: ' + f.getName());
application.output('is dir: ' + f.isDirectory());
application.output('is file: ' + f.isFile());
application.output('path: ' + f.getAbsolutePath());

// This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc.
// if filters are specified, "all file" filter will not show up unless "*" filter is present
/** @type {JSFile[]} */
var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*"));
for (var i = 0; i < files.length; i++)
{
	 application.output('File: ' + files[i].getName());
	 application.output('content type: ' + files[i].getContentType());
	 application.output('last modified: ' + files[i].lastModified());
	 application.output('size: ' + files[i].size());
}
//for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored
plugins.file.showFileOpenDialog(null,null,false,myCallbackMethod,'Select some nice files')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileOpenDialog-Number|class=node}{tr:id=name}{td}h6.showFileOpenDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileOpenDialog{span}{span:id=iets|style=float: left;}\(selectionMode){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileOpenDialog-Number_des|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_des|trigger=none|class=sIndent}Shows a file open dialog. Filters can be applied on what type of files can be selected. (Web Enabled, you must set the callback method for this to work){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileOpenDialog-Number_snc|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileOpenDialog-Number_prs|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_prs|trigger=none|class=sIndent}\{[Number]} selectionMode -- 0=both,1=Files,2=Dirs
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileOpenDialog-Number_ret|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_ret|trigger=none|class=sIndent}[Object]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileOpenDialog-Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileOpenDialog-Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileOpenDialog-Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_sam|trigger=none}{code:language=javascript}
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and
// the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")').
/** @type {JSFile} */
var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif"));
application.output('File: ' + f.getName());
application.output('is dir: ' + f.isDirectory());
application.output('is file: ' + f.isFile());
application.output('path: ' + f.getAbsolutePath());

// This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc.
// if filters are specified, "all file" filter will not show up unless "*" filter is present
/** @type {JSFile[]} */
var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*"));
for (var i = 0; i < files.length; i++)
{
	 application.output('File: ' + files[i].getName());
	 application.output('content type: ' + files[i].getContentType());
	 application.output('last modified: ' + files[i].lastModified());
	 application.output('size: ' + files[i].size());
}
//for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored
plugins.file.showFileOpenDialog(null,null,false,myCallbackMethod,'Select some nice files')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileOpenDialog-Number_Object|class=node}{tr:id=name}{td}h6.showFileOpenDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileOpenDialog{span}{span:id=iets|style=float: left;}\(selectionMode, startDirectory){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileOpenDialog-Number_Object_des|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_des|trigger=none|class=sIndent}Shows a file open dialog. Filters can be applied on what type of files can be selected. (Web Enabled, you must set the callback method for this to work){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileOpenDialog-Number_Object_snc|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileOpenDialog-Number_Object_prs|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_prs|trigger=none|class=sIndent}\{[Number]} selectionMode -- 0=both,1=Files,2=Dirs
\{[Object]} startDirectory -- null=default/previous
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileOpenDialog-Number_Object_ret|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_ret|trigger=none|class=sIndent}[Object]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileOpenDialog-Number_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileOpenDialog-Number_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileOpenDialog-Number_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_sam|trigger=none}{code:language=javascript}
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and
// the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")').
/** @type {JSFile} */
var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif"));
application.output('File: ' + f.getName());
application.output('is dir: ' + f.isDirectory());
application.output('is file: ' + f.isFile());
application.output('path: ' + f.getAbsolutePath());

// This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc.
// if filters are specified, "all file" filter will not show up unless "*" filter is present
/** @type {JSFile[]} */
var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*"));
for (var i = 0; i < files.length; i++)
{
	 application.output('File: ' + files[i].getName());
	 application.output('content type: ' + files[i].getContentType());
	 application.output('last modified: ' + files[i].lastModified());
	 application.output('size: ' + files[i].size());
}
//for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored
plugins.file.showFileOpenDialog(null,null,false,myCallbackMethod,'Select some nice files')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileOpenDialog-Number_Object_Boolean|class=node}{tr:id=name}{td}h6.showFileOpenDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileOpenDialog{span}{span:id=iets|style=float: left;}\(selectionMode, startDirectory, multiselect){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileOpenDialog-Number_Object_Boolean_des|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_des|trigger=none|class=sIndent}Shows a file open dialog. Filters can be applied on what type of files can be selected. (Web Enabled, you must set the callback method for this to work){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_snc|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_prs|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_prs|trigger=none|class=sIndent}\{[Number]} selectionMode -- 0=both,1=Files,2=Dirs
\{[Object]} startDirectory -- File or path to default folder,null=default/previous
\{[Boolean]} multiselect -- true/false
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_ret|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_ret|trigger=none|class=sIndent}[Object]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_sam|trigger=none}{code:language=javascript}
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and
// the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")').
/** @type {JSFile} */
var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif"));
application.output('File: ' + f.getName());
application.output('is dir: ' + f.isDirectory());
application.output('is file: ' + f.isFile());
application.output('path: ' + f.getAbsolutePath());

// This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc.
// if filters are specified, "all file" filter will not show up unless "*" filter is present
/** @type {JSFile[]} */
var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*"));
for (var i = 0; i < files.length; i++)
{
	 application.output('File: ' + files[i].getName());
	 application.output('content type: ' + files[i].getContentType());
	 application.output('last modified: ' + files[i].lastModified());
	 application.output('size: ' + files[i].size());
}
//for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored
plugins.file.showFileOpenDialog(null,null,false,myCallbackMethod,'Select some nice files')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileOpenDialog-Number_Object_Boolean_Object|class=node}{tr:id=name}{td}h6.showFileOpenDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileOpenDialog{span}{span:id=iets|style=float: left;}\(selectionMode, startDirectory, multiselect, filter){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_des|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_des|trigger=none|class=sIndent}Shows a file open dialog. Filters can be applied on what type of files can be selected. (Web Enabled, you must set the callback method for this to work){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_snc|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_prs|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_prs|trigger=none|class=sIndent}\{[Number]} selectionMode -- 0=both,1=Files,2=Dirs
\{[Object]} startDirectory -- File or path to default folder,null=default/previous
\{[Boolean]} multiselect -- true/false
\{[Object]} filter
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_ret|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_ret|trigger=none|class=sIndent}[Object]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_sam|trigger=none}{code:language=javascript}
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and
// the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")').
/** @type {JSFile} */
var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif"));
application.output('File: ' + f.getName());
application.output('is dir: ' + f.isDirectory());
application.output('is file: ' + f.isFile());
application.output('path: ' + f.getAbsolutePath());

// This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc.
// if filters are specified, "all file" filter will not show up unless "*" filter is present
/** @type {JSFile[]} */
var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*"));
for (var i = 0; i < files.length; i++)
{
	 application.output('File: ' + files[i].getName());
	 application.output('content type: ' + files[i].getContentType());
	 application.output('last modified: ' + files[i].lastModified());
	 application.output('size: ' + files[i].size());
}
//for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored
plugins.file.showFileOpenDialog(null,null,false,myCallbackMethod,'Select some nice files')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileOpenDialog-Number_Object_Boolean_Object_Function|class=node}{tr:id=name}{td}h6.showFileOpenDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileOpenDialog{span}{span:id=iets|style=float: left;}\(selectionMode, startDirectory, multiselect, filter, callbackmethod){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_des|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_des|trigger=none|class=sIndent}Shows a file open dialog. Filters can be applied on what type of files can be selected. (Web Enabled, you must set the callback method for this to work){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_snc|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_prs|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_prs|trigger=none|class=sIndent}\{[Number]} selectionMode -- 0=both,1=Files,2=Dirs
\{[Object]} startDirectory -- File or path to default folder,null=default/previous
\{[Boolean]} multiselect -- true/false
\{[Object]} filter -- A filter or array of filters on the folder files.
\{[Function]} callbackmethod
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_ret|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_ret|trigger=none|class=sIndent}[Object]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_sam|trigger=none}{code:language=javascript}
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and
// the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")').
/** @type {JSFile} */
var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif"));
application.output('File: ' + f.getName());
application.output('is dir: ' + f.isDirectory());
application.output('is file: ' + f.isFile());
application.output('path: ' + f.getAbsolutePath());

// This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc.
// if filters are specified, "all file" filter will not show up unless "*" filter is present
/** @type {JSFile[]} */
var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*"));
for (var i = 0; i < files.length; i++)
{
	 application.output('File: ' + files[i].getName());
	 application.output('content type: ' + files[i].getContentType());
	 application.output('last modified: ' + files[i].lastModified());
	 application.output('size: ' + files[i].size());
}
//for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored
plugins.file.showFileOpenDialog(null,null,false,myCallbackMethod,'Select some nice files')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileOpenDialog-Number_Object_Boolean_Object_Function_String|class=node}{tr:id=name}{td}h6.showFileOpenDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileOpenDialog{span}{span:id=iets|style=float: left;}\(selectionMode, startDirectory, multiselect, filter, callbackmethod, title){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_des|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_des|trigger=none|class=sIndent}Shows a file open dialog. Filters can be applied on what type of files can be selected. (Web Enabled, you must set the callback method for this to work){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_snc|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_prs|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_prs|trigger=none|class=sIndent}\{[Number]} selectionMode -- 0=both,1=Files,2=Dirs
\{[Object]} startDirectory -- null=default/previous
\{[Boolean]} multiselect -- true/false
\{[Object]} filter -- A filter or array of filters on the folder files.
\{[Function]} callbackmethod
\{[String]} title
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_ret|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_ret|trigger=none|class=sIndent}[Object]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_Object_Function_String_sam|trigger=none}{code:language=javascript}
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and
// the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")').
/** @type {JSFile} */
var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif"));
application.output('File: ' + f.getName());
application.output('is dir: ' + f.isDirectory());
application.output('is file: ' + f.isFile());
application.output('path: ' + f.getAbsolutePath());

// This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc.
// if filters are specified, "all file" filter will not show up unless "*" filter is present
/** @type {JSFile[]} */
var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*"));
for (var i = 0; i < files.length; i++)
{
	 application.output('File: ' + files[i].getName());
	 application.output('content type: ' + files[i].getContentType());
	 application.output('last modified: ' + files[i].lastModified());
	 application.output('size: ' + files[i].size());
}
//for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored
plugins.file.showFileOpenDialog(null,null,false,myCallbackMethod,'Select some nice files')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileOpenDialog-Number_Object_Boolean_Function|class=node}{tr:id=name}{td}h6.showFileOpenDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileOpenDialog{span}{span:id=iets|style=float: left;}\(selectionMode, startDirectory, multiselect, callbackmethod){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_des|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_des|trigger=none|class=sIndent}Shows a file open dialog. Filters can be applied on what type of files can be selected. (Web Enabled, you must set the callback method for this to work){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_snc|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_prs|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_prs|trigger=none|class=sIndent}\{[Number]} selectionMode -- 0=both,1=Files,2=Dirs
\{[Object]} startDirectory -- File or path to default folder,null=default/previous
\{[Boolean]} multiselect -- true/false
\{[Function]} callbackmethod
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_ret|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_ret|trigger=none|class=sIndent}[Object]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Boolean_Function_sam|trigger=none}{code:language=javascript}
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and
// the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")').
/** @type {JSFile} */
var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif"));
application.output('File: ' + f.getName());
application.output('is dir: ' + f.isDirectory());
application.output('is file: ' + f.isFile());
application.output('path: ' + f.getAbsolutePath());

// This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc.
// if filters are specified, "all file" filter will not show up unless "*" filter is present
/** @type {JSFile[]} */
var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*"));
for (var i = 0; i < files.length; i++)
{
	 application.output('File: ' + files[i].getName());
	 application.output('content type: ' + files[i].getContentType());
	 application.output('last modified: ' + files[i].lastModified());
	 application.output('size: ' + files[i].size());
}
//for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored
plugins.file.showFileOpenDialog(null,null,false,myCallbackMethod,'Select some nice files')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileOpenDialog-Number_Object_Function|class=node}{tr:id=name}{td}h6.showFileOpenDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileOpenDialog{span}{span:id=iets|style=float: left;}\(selectionMode, startDirectory, callbackmethod){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileOpenDialog-Number_Object_Function_des|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Function_des|trigger=none|class=sIndent}Shows a file open dialog. Filters can be applied on what type of files can be selected. (Web Enabled, you must set the callback method for this to work){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileOpenDialog-Number_Object_Function_snc|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Function_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileOpenDialog-Number_Object_Function_prs|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Function_prs|trigger=none|class=sIndent}\{[Number]} selectionMode -- 0=both,1=Files,2=Dirs
\{[Object]} startDirectory -- File or path to default folder,null=default/previous
\{[Function]} callbackmethod
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileOpenDialog-Number_Object_Function_ret|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Object_Function_ret|trigger=none|class=sIndent}[Object]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileOpenDialog-Number_Object_Function_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Function_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileOpenDialog-Number_Object_Function_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Function_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileOpenDialog-Number_Object_Function_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Object_Function_sam|trigger=none}{code:language=javascript}
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and
// the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")').
/** @type {JSFile} */
var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif"));
application.output('File: ' + f.getName());
application.output('is dir: ' + f.isDirectory());
application.output('is file: ' + f.isFile());
application.output('path: ' + f.getAbsolutePath());

// This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc.
// if filters are specified, "all file" filter will not show up unless "*" filter is present
/** @type {JSFile[]} */
var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*"));
for (var i = 0; i < files.length; i++)
{
	 application.output('File: ' + files[i].getName());
	 application.output('content type: ' + files[i].getContentType());
	 application.output('last modified: ' + files[i].lastModified());
	 application.output('size: ' + files[i].size());
}
//for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored
plugins.file.showFileOpenDialog(null,null,false,myCallbackMethod,'Select some nice files')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileOpenDialog-Number_Function|class=node}{tr:id=name}{td}h6.showFileOpenDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileOpenDialog{span}{span:id=iets|style=float: left;}\(selectionMode, callbackmethod){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileOpenDialog-Number_Function_des|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Function_des|trigger=none|class=sIndent}Shows a file open dialog. Filters can be applied on what type of files can be selected. (Web Enabled, you must set the callback method for this to work){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileOpenDialog-Number_Function_snc|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Function_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileOpenDialog-Number_Function_prs|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Function_prs|trigger=none|class=sIndent}\{[Number]} selectionMode -- 0=both,1=Files,2=Dirs
\{[Function]} callbackmethod
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileOpenDialog-Number_Function_ret|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Number_Function_ret|trigger=none|class=sIndent}[Object]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileOpenDialog-Number_Function_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Function_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileOpenDialog-Number_Function_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Function_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileOpenDialog-Number_Function_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Number_Function_sam|trigger=none}{code:language=javascript}
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and
// the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")').
/** @type {JSFile} */
var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif"));
application.output('File: ' + f.getName());
application.output('is dir: ' + f.isDirectory());
application.output('is file: ' + f.isFile());
application.output('path: ' + f.getAbsolutePath());

// This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc.
// if filters are specified, "all file" filter will not show up unless "*" filter is present
/** @type {JSFile[]} */
var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*"));
for (var i = 0; i < files.length; i++)
{
	 application.output('File: ' + files[i].getName());
	 application.output('content type: ' + files[i].getContentType());
	 application.output('last modified: ' + files[i].lastModified());
	 application.output('size: ' + files[i].size());
}
//for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored
plugins.file.showFileOpenDialog(null,null,false,myCallbackMethod,'Select some nice files')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileOpenDialog-Function|class=node}{tr:id=name}{td}h6.showFileOpenDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileOpenDialog{span}{span:id=iets|style=float: left;}\(callbackmethod){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileOpenDialog-Function_des|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Function_des|trigger=none|class=sIndent}Shows a file open dialog. Filters can be applied on what type of files can be selected. (Web Enabled, you must set the callback method for this to work){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileOpenDialog-Function_snc|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Function_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileOpenDialog-Function_prs|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Function_prs|trigger=none|class=sIndent}\{[Function]} callbackmethod
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileOpenDialog-Function_ret|text=|trigger=button}{sub-section}{sub-section:showFileOpenDialog-Function_ret|trigger=none|class=sIndent}[Object]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileOpenDialog-Function_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Function_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileOpenDialog-Function_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Function_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileOpenDialog-Function_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileOpenDialog-Function_sam|trigger=none}{code:language=javascript}
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and
// the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")').
/** @type {JSFile} */
var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif"));
application.output('File: ' + f.getName());
application.output('is dir: ' + f.isDirectory());
application.output('is file: ' + f.isFile());
application.output('path: ' + f.getAbsolutePath());

// This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc.
// if filters are specified, "all file" filter will not show up unless "*" filter is present
/** @type {JSFile[]} */
var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*"));
for (var i = 0; i < files.length; i++)
{
	 application.output('File: ' + files[i].getName());
	 application.output('content type: ' + files[i].getContentType());
	 application.output('last modified: ' + files[i].lastModified());
	 application.output('size: ' + files[i].size());
}
//for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored
plugins.file.showFileOpenDialog(null,null,false,myCallbackMethod,'Select some nice files')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileSaveDialog|class=node}{tr:id=name}{td}h6.showFileSaveDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileSaveDialog{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileSaveDialog_des|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialog_des|trigger=none|class=sIndent}Shows a file save dialog.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileSaveDialog_snc|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialog_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileSaveDialog_prs|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialog_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:showFileSaveDialog_ret|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialog_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileSaveDialog_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileSaveDialog_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileSaveDialog_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileSaveDialog_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileSaveDialog_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileSaveDialog_sam|trigger=none}{code:language=javascript}
var file = plugins.file.showFileSaveDialog();
application.output("you've selected file: " + file.getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileSaveDialog-Object|class=node}{tr:id=name}{td}h6.showFileSaveDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileSaveDialog{span}{span:id=iets|style=float: left;}\(fileNameDir){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileSaveDialog-Object_des|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialog-Object_des|trigger=none|class=sIndent}Shows a file save dialog.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileSaveDialog-Object_snc|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialog-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileSaveDialog-Object_prs|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialog-Object_prs|trigger=none|class=sIndent}\{[Object]} fileNameDir -- File to save.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileSaveDialog-Object_ret|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialog-Object_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileSaveDialog-Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileSaveDialog-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileSaveDialog-Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileSaveDialog-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileSaveDialog-Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileSaveDialog-Object_sam|trigger=none}{code:language=javascript}
var file = plugins.file.showFileSaveDialog();
application.output("you've selected file: " + file.getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileSaveDialog-Object_String|class=node}{tr:id=name}{td}h6.showFileSaveDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileSaveDialog{span}{span:id=iets|style=float: left;}\(fileNameDir, title){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileSaveDialog-Object_String_des|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialog-Object_String_des|trigger=none|class=sIndent}Shows a file save dialog.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileSaveDialog-Object_String_snc|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialog-Object_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileSaveDialog-Object_String_prs|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialog-Object_String_prs|trigger=none|class=sIndent}\{[Object]} fileNameDir
\{[String]} title -- Dialog title.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileSaveDialog-Object_String_ret|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialog-Object_String_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileSaveDialog-Object_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileSaveDialog-Object_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileSaveDialog-Object_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileSaveDialog-Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileSaveDialog-Object_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileSaveDialog-Object_String_sam|trigger=none}{code:language=javascript}
var file = plugins.file.showFileSaveDialog();
application.output("you've selected file: " + file.getAbsolutePath());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=streamFilesFromServer-Object_Object|class=node}{tr:id=name}{td}h6.streamFilesFromServer{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSProgressMonitor]{span}{span:id=iets|style=float: left; font-weight: bold;}streamFilesFromServer{span}{span:id=iets|style=float: left;}\(f, s){span}{td}{tr}{tr:id=des}{td}{sub-section:streamFilesFromServer-Object_Object_des|text=|trigger=button}{sub-section}{sub-section:streamFilesFromServer-Object_Object_des|trigger=none|class=sIndent}Stream 1 or more file from the server to the client.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:streamFilesFromServer-Object_Object_snc|text=|trigger=button}{sub-section}{sub-section:streamFilesFromServer-Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:streamFilesFromServer-Object_Object_prs|text=|trigger=button}{sub-section}{sub-section:streamFilesFromServer-Object_Object_prs|trigger=none|class=sIndent}\{[Object]} f -- file(s) to be streamed into (can be a String path, a File or a JSFile) or an Array of these
\{[Object]} s -- of the files on the server that will be transfered to the client, can be a String or a String\[\]
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:streamFilesFromServer-Object_Object_ret|text=|trigger=button}{sub-section}{sub-section:streamFilesFromServer-Object_Object_ret|trigger=none|class=sIndent}[JSProgressMonitor] -- a JSProgressMonitor object to allow client to subscribe to progress notifications{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:streamFilesFromServer-Object_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesFromServer-Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:streamFilesFromServer-Object_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesFromServer-Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:streamFilesFromServer-Object_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesFromServer-Object_Object_sam|trigger=none}{code:language=javascript}
// transfer all the files of a chosen server folder to a directory on the client
var dir = plugins.file.showDirectorySelectDialog();
if (dir) {
	var list = plugins.file.getRemoteFolderContents('/images/user1/', null, 1);
	if (list) {
		var monitor = plugins.file.streamFilesFromServer(dir, list, callbackFunction);
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=streamFilesFromServer-Object_Object_Function|class=node}{tr:id=name}{td}h6.streamFilesFromServer{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSProgressMonitor]{span}{span:id=iets|style=float: left; font-weight: bold;}streamFilesFromServer{span}{span:id=iets|style=float: left;}\(f, s, callback){span}{td}{tr}{tr:id=des}{td}{sub-section:streamFilesFromServer-Object_Object_Function_des|text=|trigger=button}{sub-section}{sub-section:streamFilesFromServer-Object_Object_Function_des|trigger=none|class=sIndent}Stream 1 or more files from the server to the client, the callback method is invoked after every file, with as argument
the filename that was transfered. An extra second exception parameter can be given if an exception did occur.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:streamFilesFromServer-Object_Object_Function_snc|text=|trigger=button}{sub-section}{sub-section:streamFilesFromServer-Object_Object_Function_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:streamFilesFromServer-Object_Object_Function_prs|text=|trigger=button}{sub-section}{sub-section:streamFilesFromServer-Object_Object_Function_prs|trigger=none|class=sIndent}\{[Object]} f -- file(s) to be streamed into (can be a String path, a File or a JSFile) or an Array of these
\{[Object]} s -- the files on the server that will be transfered to the client, can be a JSFile or JSFile\[\], a String or String\[\]
\{[Function]} callback -- the Function to be called back at the end of the process (after every file)
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:streamFilesFromServer-Object_Object_Function_ret|text=|trigger=button}{sub-section}{sub-section:streamFilesFromServer-Object_Object_Function_ret|trigger=none|class=sIndent}[JSProgressMonitor] -- a JSProgressMonitor object to allow client to subscribe to progress notifications{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:streamFilesFromServer-Object_Object_Function_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesFromServer-Object_Object_Function_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:streamFilesFromServer-Object_Object_Function_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesFromServer-Object_Object_Function_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:streamFilesFromServer-Object_Object_Function_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesFromServer-Object_Object_Function_sam|trigger=none}{code:language=javascript}
// transfer all the files of a chosen server folder to a directory on the client
var dir = plugins.file.showDirectorySelectDialog();
if (dir) {
	var list = plugins.file.getRemoteFolderContents('/images/user1/', null, 1);
	if (list) {
		var monitor = plugins.file.streamFilesFromServer(dir, list, callbackFunction);
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=streamFilesToServer-Object|class=node}{tr:id=name}{td}h6.streamFilesToServer{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSProgressMonitor]{span}{span:id=iets|style=float: left; font-weight: bold;}streamFilesToServer{span}{span:id=iets|style=float: left;}\(f){span}{td}{tr}{tr:id=des}{td}{sub-section:streamFilesToServer-Object_des|text=|trigger=button}{sub-section}{sub-section:streamFilesToServer-Object_des|trigger=none|class=sIndent}Overloaded method, only defines file(s) to be streamed{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:streamFilesToServer-Object_snc|text=|trigger=button}{sub-section}{sub-section:streamFilesToServer-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:streamFilesToServer-Object_prs|text=|trigger=button}{sub-section}{sub-section:streamFilesToServer-Object_prs|trigger=none|class=sIndent}\{[Object]} f -- file(s) to be streamed (can be a String path, a File or a JSFile) or an Array of these
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:streamFilesToServer-Object_ret|text=|trigger=button}{sub-section}{sub-section:streamFilesToServer-Object_ret|trigger=none|class=sIndent}[JSProgressMonitor] -- a JSProgressMonitor object to allow client to subscribe to progress notifications{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:streamFilesToServer-Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesToServer-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:streamFilesToServer-Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesToServer-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:streamFilesToServer-Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesToServer-Object_sam|trigger=none}{code:language=javascript}
// send one file:
var file = plugins.file.showFileOpenDialog( 1, null, false, null, null, 'Choose a file to transfer' );
if (file) {
	plugins.file.streamFilesToServer( file, callbackFunction );
}
// send an array of files:
var folder = plugins.file.showDirectorySelectDialog();
if (folder) {
	var files = plugins.file.getFolderContents(folder);
	if (files) {
		var monitor = plugins.file.streamFilesToServer( files, callbackFunction );
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=streamFilesToServer-Object_Object|class=node}{tr:id=name}{td}h6.streamFilesToServer{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSProgressMonitor]{span}{span:id=iets|style=float: left; font-weight: bold;}streamFilesToServer{span}{span:id=iets|style=float: left;}\(f, o){span}{td}{tr}{tr:id=des}{td}{sub-section:streamFilesToServer-Object_Object_des|text=|trigger=button}{sub-section}{sub-section:streamFilesToServer-Object_Object_des|trigger=none|class=sIndent}Overloaded method, defines file(s) to be streamed and a callback function{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:streamFilesToServer-Object_Object_snc|text=|trigger=button}{sub-section}{sub-section:streamFilesToServer-Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:streamFilesToServer-Object_Object_prs|text=|trigger=button}{sub-section}{sub-section:streamFilesToServer-Object_Object_prs|trigger=none|class=sIndent}\{[Object]} f -- file(s) to be streamed (can be a String path, a File or a JSFile) or an Array of these
\{[Object]} o -- can be a JSFile or JSFile\[\], a String or String\[\] or the Function to be called back at the end of the process
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:streamFilesToServer-Object_Object_ret|text=|trigger=button}{sub-section}{sub-section:streamFilesToServer-Object_Object_ret|trigger=none|class=sIndent}[JSProgressMonitor] -- a JSProgressMonitor object to allow client to subscribe to progress notifications{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:streamFilesToServer-Object_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesToServer-Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:streamFilesToServer-Object_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesToServer-Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:streamFilesToServer-Object_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesToServer-Object_Object_sam|trigger=none}{code:language=javascript}
// send one file:
var file = plugins.file.showFileOpenDialog( 1, null, false, null, null, 'Choose a file to transfer' );
if (file) {
	plugins.file.streamFilesToServer( file, callbackFunction );
}
// send an array of files:
var folder = plugins.file.showDirectorySelectDialog();
if (folder) {
	var files = plugins.file.getFolderContents(folder);
	if (files) {
		var monitor = plugins.file.streamFilesToServer( files, callbackFunction );
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=streamFilesToServer-Object_Object_Function|class=node}{tr:id=name}{td}h6.streamFilesToServer{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSProgressMonitor]{span}{span:id=iets|style=float: left; font-weight: bold;}streamFilesToServer{span}{span:id=iets|style=float: left;}\(f, s, callback){span}{td}{tr}{tr:id=des}{td}{sub-section:streamFilesToServer-Object_Object_Function_des|text=|trigger=button}{sub-section}{sub-section:streamFilesToServer-Object_Object_Function_des|trigger=none|class=sIndent}Overloaded method, defines file(s) to be streamed, a callback function and file name(s) to use on the server{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:streamFilesToServer-Object_Object_Function_snc|text=|trigger=button}{sub-section}{sub-section:streamFilesToServer-Object_Object_Function_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:streamFilesToServer-Object_Object_Function_prs|text=|trigger=button}{sub-section}{sub-section:streamFilesToServer-Object_Object_Function_prs|trigger=none|class=sIndent}\{[Object]} f -- file(s) to be streamed (can be a String path, a File or a JSFile) or an Array of these
\{[Object]} s -- can be a JSFile or JSFile\[\], a String or String\[\]
\{[Function]} callback -- the Function to be called back at the end of the process
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:streamFilesToServer-Object_Object_Function_ret|text=|trigger=button}{sub-section}{sub-section:streamFilesToServer-Object_Object_Function_ret|trigger=none|class=sIndent}[JSProgressMonitor] -- a JSProgressMonitor object to allow client to subscribe to progress notifications{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:streamFilesToServer-Object_Object_Function_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesToServer-Object_Object_Function_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:streamFilesToServer-Object_Object_Function_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesToServer-Object_Object_Function_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:streamFilesToServer-Object_Object_Function_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesToServer-Object_Object_Function_sam|trigger=none}{code:language=javascript}
// send one file:
var file = plugins.file.showFileOpenDialog( 1, null, false, null, null, 'Choose a file to transfer' );
if (file) {
	plugins.file.streamFilesToServer( file, callbackFunction );
}
// send an array of files:
var folder = plugins.file.showDirectorySelectDialog();
if (folder) {
	var files = plugins.file.getFolderContents(folder);
	if (files) {
		var monitor = plugins.file.streamFilesToServer( files, callbackFunction );
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=writeFile-Object_byteArray|class=node}{tr:id=name}{td}h6.writeFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}writeFile{span}{span:id=iets|style=float: left;}\(f, data){span}{td}{tr}{tr:id=des}{td}{sub-section:writeFile-Object_byteArray_des|text=|trigger=button}{sub-section}{sub-section:writeFile-Object_byteArray_des|trigger=none|class=sIndent}Writes data into a binary file. (Web Enabled: file parameter can be a string 'mypdffile.pdf' to hint the browser what it is, if it is a JSFile instance it will be saved on the server){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:writeFile-Object_byteArray_snc|text=|trigger=button}{sub-section}{sub-section:writeFile-Object_byteArray_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:writeFile-Object_byteArray_prs|text=|trigger=button}{sub-section}{sub-section:writeFile-Object_byteArray_prs|trigger=none|class=sIndent}\{[Object]} f
\{byte[]} data
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:writeFile-Object_byteArray_ret|text=|trigger=button}{sub-section}{sub-section:writeFile-Object_byteArray_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:writeFile-Object_byteArray_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:writeFile-Object_byteArray_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:writeFile-Object_byteArray_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:writeFile-Object_byteArray_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:writeFile-Object_byteArray_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:writeFile-Object_byteArray_sam|trigger=none}{code:language=javascript}
/**@type {Array<byte>}*/
var bytes = new Array();
for (var i=0; i<1024; i++)
	bytes[i] = i % 100;
var f = plugins.file.convertToJSFile('bin.dat');
if (!plugins.file.writeFile(f, bytes))
	application.output('Failed to write the file.');
// mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp'
var mimeType = 'application/vnd.ms-excel'
if (!plugins.file.writeFile(f, bytes, mimeType))
	application.output('Failed to write the file.');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=showFileSaveDialogwriteFile-Object_byteArray_String|class=node}{tr:id=name}{td}h6.showFileSaveDialogwriteFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFileBoolean]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileSaveDialogwriteFile{span}{span:id=iets|style=float: left;}\(\[fileName/dir suggestion\], \[dialog title text\]f, data, mimeType){span}{td}{tr}{tr:id=des}{td}{sub-section:showFileSaveDialogwriteFile-Object_byteArray_String_des|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialog_des|trigger=none|class=sIndent}Shows a file save dialog.{sub-section:writeFile-Object_byteArray_String_des|trigger=none|class=sIndent}Writes data into a binary file. (Web Enabled: file parameter can be a string 'mypdffile.pdf' to hint the browser what it is, if it is a JSFile instance it will be saved on the server){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:showFileSaveDialogwriteFile-Object_byteArray_String_snc|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialogwriteFile-Object_byteArray_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:showFileSaveDialogwriteFile-Object_byteArray_String_prs|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialogwriteFile-Object_byteArray_String_prs|trigger=none|class=sIndent}\[fileName/dir suggestion\]
\[dialog title text\]{[Object]} f
\{byte[]} data
\{[String]} mimeType
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:showFileSaveDialogwriteFile-Object_byteArray_String_ret|text=|trigger=button}{sub-section}{sub-section:showFileSaveDialogwriteFile-Object_byteArray_String_ret|trigger=none|class=sIndent}[JSFileBoolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:showFileSaveDialogwriteFile-Object_byteArray_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileSaveDialogwriteFile-Object_byteArray_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:showFileSaveDialogwriteFile-Object_byteArray_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileSaveDialogwriteFile-Object_byteArray_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:showFileSaveDialogwriteFile-Object_byteArray_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:showFileSaveDialog_sam|trigger=none}{code:language=javascript}
var filewriteFile-Object_byteArray_String_sam|trigger=none}{code:language=javascript}
/**@type {Array<byte>}*/
var bytes = new Array();
for (var i=0; i<1024; i++)
	bytes[i] = i % 100;
var f = plugins.file.showFileSaveDialogconvertToJSFile('bin.dat');
if (!plugins.file.writeFile(f, bytes))
	application.output("you've selected file: " + file.getAbsolutePath()'Failed to write the file.');
// mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp'
var mimeType = 'application/vnd.ms-excel'
if (!plugins.file.writeFile(f, bytes, mimeType))
	application.output('Failed to write the file.');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=streamFilesFromServerwriteTXTFile-Object_String|class=node}{tr:id=name}{td}h6.streamFilesFromServerwriteTXTFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSProgressMonitorBoolean]{span}{span:id=iets|style=float: left; font-weight: bold;}streamFilesFromServerwriteTXTFile{span}{span:id=iets|style=float: left;}\(file/fileName|fileArray/fileNameArray, serverFile/serverFileName|serverFileArray/serverFileNameArray, \[callbackFunction\]left;}\(file, text_data){span}{td}{tr}{tr:id=des}{td}{sub-section:streamFilesFromServerwriteTXTFile-Object_String_des|text=|trigger=button}{sub-section}{sub-section:streamFilesFromServerwriteTXTFile-Object_String_des|trigger=none|class=sIndent}StreamsWrites a file or an array of files from the server in a background task to a file (or files) on the client. If provided, calls back a Servoy function when done for each file received with a JSFile and an exception if anything went wrong, returns a JSProgressMonitor object. Note: This only streams files for the smart client, in the webclient the streaming from the server to the browser is done by the browserdata into a text file. (Web Enabled: file parameter can be a string 'mytextfile.txt' to hint the browser what it is, if it is a JSFile instance it will be saved on the server){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:streamFilesFromServerwriteTXTFile-Object_String_snc|text=|trigger=button}{sub-section}{sub-section:streamFilesFromServerwriteTXTFile-Object_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:streamFilesFromServerwriteTXTFile-Object_String_prs|text=|trigger=button}{sub-section}{sub-section:streamFilesFromServerwriteTXTFile-Object_String_prs|trigger=none|class=sIndent}file/fileName|fileArray/fileNameArray
serverFile/serverFileName|serverFileArray/serverFileNameArray
\[callbackFunction\]
\{[Object]} file -- JSFile or path.
\{[String]} text_data -- Text to be written.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:streamFilesFromServerwriteTXTFile-Object_String_ret|text=|trigger=button}{sub-section}{sub-section:streamFilesFromServerwriteTXTFile-Object_String_ret|trigger=none|class=sIndent}[JSProgressMonitor]Boolean] -- Success boolean.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:streamFilesFromServerwriteTXTFile-Object_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesFromServerwriteTXTFile-Object_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:streamFilesFromServerwriteTXTFile-Object_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesFromServerwriteTXTFile-Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:streamFilesFromServerwriteTXTFile-Object_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesFromServerwriteTXTFile-Object_String_sam|trigger=none}{code:language=javascript}
// transfer all the files of a chosen server folder to a directory on the client
	var dir = plugins.file.showDirectorySelectDialog();
	if (dir) {
		var list = plugins.file.getRemoteFolderContents('/images/user1/', null, 1);
		if (list) {
			var monitor = plugins.file.streamFilesFromServer(dir, list, callbackFunction);
		}
	}
var fileNameSuggestion = 'myspecialexport.tab'
var textData = 'load of data...'
var success = plugins.file.writeTXTFile(fileNameSuggestion, textData);
if (!success) application.output('Could not write file.');
// For file-encoding parameter options (default OS encoding is used), http://download.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html
// mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp'
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=streamFilesToServerwriteTXTFile-Object_String_String|class=node}{tr:id=name}{td}h6.streamFilesToServerwriteTXTFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSProgressMonitorBoolean]{span}{span:id=iets|style=float: left; font-weight: bold;}streamFilesToServerwriteTXTFile{span}{span:id=iets|style=float: left;}\(file/fileName|fileArray/fileNameArray, \[serverFile/serverFileName|serverFileArray/serverFileNameArray\], \[callbackFunction\], text_data, charsetname){span}{td}{tr}{tr:id=des}{td}{sub-section:streamFilesToServerwriteTXTFile-Object_String_String_des|text=|trigger=button}{sub-section}{sub-section:streamFilesToServer_des|trigger=none|class=sIndent}Streams a file or an array of files to the server in a background task \- with optional relative path(s)/(new) name(s). If provided, calls back a Servoy function when done for each file received with a JSFile and an exception if anything went wrong, returns a JSProgressMonitor object. Note: This only streams files for the smart client, in the webclient the streaming from the browser to the server is done by the browserwriteTXTFile-Object_String_String_des|trigger=none|class=sIndent}Writes data into a text file. (Web Enabled: file parameter can be a string 'mytextfile.txt' to hint the browser what it is, if it is a JSFile instance it will be saved on the server){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:streamFilesToServerwriteTXTFile-Object_String_String_snc|text=|trigger=button}{sub-section}{sub-section:streamFilesToServerwriteTXTFile-Object_String_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:streamFilesToServerwriteTXTFile-Object_String_String_prs|text=|trigger=button}{sub-section}{sub-section:streamFilesToServerwriteTXTFile-Object_String_String_prs|trigger=none|class=sIndent}file/fileName|fileArray/fileNameArray
\[serverFile/serverFileName|serverFileArray/serverFileNameArray\]
\[callbackFunction\]\{[Object]} file -- JSFile or path.
\{[String]} text_data -- Text to be written.
\{[String]} charsetname -- Charset name.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:streamFilesToServerwriteTXTFile-Object_String_String_ret|text=|trigger=button}{sub-section}{sub-section:streamFilesToServerwriteTXTFile-Object_String_String_ret|trigger=none|class=sIndent}[JSProgressMonitor]Boolean] -- Success boolean.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:streamFilesToServerwriteTXTFile-Object_String_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesToServerwriteTXTFile-Object_String_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:streamFilesToServerwriteTXTFile-Object_String_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesToServerwriteTXTFile-Object_String_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:streamFilesToServerwriteTXTFile-Object_String_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:streamFilesToServerwriteTXTFile-Object_String_String_sam|trigger=none}{code:language=javascript}
// send one file:
	var filevar fileNameSuggestion = 'myspecialexport.tab'
var textData = 'load of data...'
var success = plugins.file.showFileOpenDialogwriteTXTFile( 1fileNameSuggestion, null, false, null, null, 'Choose a file to transfer' );
	if (file) {
		plugins.file.streamFilesToServer( file, callbackFunction );
	}
	// send an array of files:
	var folder = plugins.file.showDirectorySelectDialog();
	if (folder) {
		var files = plugins.file.getFolderContents(folder);
		if (files) {
			var monitor = plugins.file.streamFilesToServer( files, callbackFunction );
		}
	}
textData);
if (!success) application.output('Could not write file.');
// For file-encoding parameter options (default OS encoding is used), http://download.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html
// mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp'
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=writeFilewriteTXTFile-Object_String_String_String|class=node}{tr:id=name}{td}h6.writeFilewriteTXTFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}writeFilewriteTXTFile{span}{span:id=iets|style=float: left;}\(file, binarytext_data, charsetname, \[mimeType\]){span}{td}{tr}{tr:id=des}{td}{sub-section:writeFilewriteTXTFile-Object_String_String_String_des|text=|trigger=button}{sub-section}{sub-section:writeFilewriteTXTFile-Object_String_String_String_des|trigger=none|class=sIndent}Writes data into a binarytext file. (Web Enabled: file parameter can be a string 'mypdffilemytextfile.pdftxt' to hint the browser what it is, if it is a JSFile instance it will be saved on the server){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:writeFilewriteTXTFile-Object_String_String_String_snc|text=|trigger=button}{sub-section}{sub-section:writeFilewriteTXTFile-Object_String_String_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:writeFilewriteTXTFile-Object_String_String_String_prs|text=|trigger=button}{sub-section}{sub-section:writeFilewriteTXTFile-Object_String_String_String_prs|trigger=none|class=sIndent}file
binary_data
\[mimeType\]
class=sIndent}\{[Object]} file -- JSFile or path.
\{[String]} text_data -- Text to be written.
\{[String]} charsetname -- Charset name.
\{[String]} mimeType -- Content type (used only on web).
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:writeFilewriteTXTFile-Object_String_String_String_ret|text=|trigger=button}{sub-section}{sub-section:writeFilewriteTXTFile-Object_String_String_String_ret|trigger=none|class=sIndent}[Boolean] -- Success boolean.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:writeFilewriteTXTFile-Object_String_String_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:writeFilewriteTXTFile-Object_String_String_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:writeFilewriteTXTFile-Object_String_String_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:writeFilewriteTXTFile-Object_String_String_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:writeFilewriteTXTFile-Object_String_String_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:writeFilewriteTXTFile-Object_String_String_String_sam|trigger=none}{code:language=javascript}
var bytesfileNameSuggestion = new Array();
	for (var i=0; i<1024; i++)
		bytes[i] = i % 100;
	var f'myspecialexport.tab'
var textData = 'load of data...'
var success = plugins.file.convertToJSFile('bin.dat');
	if (!plugins.file.writeFile(f, bytes))
		writeTXTFile(fileNameSuggestion, textData);
if (!success) application.output('FailedCould tonot write the file.');
	
// For file-encoding parameter options (default OS encoding is used), http://download.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html
// mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp'
	var mimeType = 'application/vnd.ms-excel'
	if (!plugins.file.writeFile(f, bytes, mimeType))
		application.output('Failed to write the file.');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=writeTXTFilewriteXMLFile-Object_String|class=node}{tr:id=name}{td}h6.writeTXTFilewriteXMLFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}writeTXTFilewriteXMLFile{span}{span:id=iets|style=float: left;}\(file, textxml_data, \[charsetname\], \[mimeType\]){span}{td}{tr}{tr:id=des}{td}{sub-section:writeTXTFilewriteXMLFile-Object_String_des|text=|trigger=button}{sub-section}{sub-section:writeTXTFilewriteXMLFile-Object_String_des|trigger=none|class=sIndent}Writes data into aan textXML file. The file is saved with the encoding specified by the XML itself. (Web Enabled: file parameter can be a string 'mytextfilemyxmlfile.txtxml' to hint the browser what it is, if it is a JSFile instance it will be saved on the server){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:writeTXTFilewriteXMLFile-Object_String_snc|text=|trigger=button}{sub-section}{sub-section:writeTXTFilewriteXMLFile-Object_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:writeTXTFile:writeXMLFile-Object_String_prs|text=|trigger=button}{sub-section}{sub-section:writeTXTFilewriteXMLFile-Object_String_prs|trigger=none|class=sIndent}file
text_data
\{[charsetname\Object]} file
\{[mimeType\]String]} xml_data
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:writeTXTFilewriteXMLFile-Object_String_ret|text=|trigger=button}{sub-section}{sub-section:writeTXTFilewriteXMLFile-Object_String_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:writeTXTFilewriteXMLFile-Object_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:writeTXTFilewriteXMLFile-Object_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:writeTXTFilewriteXMLFile-Object_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:writeTXTFilewriteXMLFile-Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:writeTXTFilewriteXMLFile-Object_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:writeTXTFile_sam|trigger=none}{code:language=javascript}
var fileNameSuggestion = 'myspecialexport.tab'
	var textData = 'load of data...'
	var success = plugins.file.writeTXTFile(fileNameSuggestion, textData);
	if (!success) application.output('Could not write file.');
	// For file-encoding parameter options (default OS encoding is used), http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html
	// mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp'writeXMLFile-Object_String_sam|trigger=none}{code:language=javascript}
var fileName = 'form.xml'
var xml = controller.printXML()
var success = plugins.file.writeXMLFile(fileName, xml);
if (!success) application.output('Could not write file.');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=writeXMLFile-Object_String_String|class=node}{tr:id=name}{td}h6.writeXMLFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}writeXMLFile{span}{span:id=iets|style=float: left;}\(file, xml_data, encoding){span}{td}{tr}{tr:id=des}{td}{sub-section:writeXMLFile-Object_String_String_des|text=|trigger=button}{sub-section}{sub-section:writeXMLFile-Object_String_String_des|trigger=none|class=sIndent}Writes data into an XML file. The file is saved with the encoding specified by the XML itself. (Web Enabled: file parameter can be a string 'myxmlfile.xml' to hint the browser what it is, if it is a JSFile instance it will be saved on the server){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:writeXMLFile-Object_String_String_snc|text=|trigger=button}{sub-section}{sub-section:writeXMLFile-Object_String_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:writeXMLFile-Object_String_String_prs|text=|trigger=button}{sub-section}{sub-section:writeXMLFile-Object_String_String_prs|trigger=none|class=sIndent}\{[Object]} file
\{[String]} xml_data
\{[String]} encoding
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:writeXMLFile-Object_String_String_ret|text=|trigger=button}{sub-section}{sub-section:writeXMLFile-Object_String_String_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:writeXMLFile-Object_String_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:writeXMLFile-Object_String_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:writeXMLFile-Object_String_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:writeXMLFile-Object_String_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:writeXMLFile-Object_String_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:writeXMLFile-Object_String_String_sam|trigger=none}{code:language=javascript}
var fileName = 'form.xml'
var xml = controller.printXML()
var success = plugins.file.writeXMLFile(fileName, xml);
if (!success) application.output('Could not write file.');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}