{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=}{sub-section}\\
{table:class=servoy sReturnTypes}{tr:style=height: 30px;}{th}Return Types{th}{tr}{tr}{td}{span:class=sWordList}[JSFile]{span}{td}{tr}{table}\\
{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{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}[Boolean]{td}{td}[#copyFile]\(sourceFile, destinationFile)
Copies the sourcefile to the destination file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#copyFolder]\(sourceFolder, destinationFolder)
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]\(targetFolder)
Creates a folder on disk.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#createTempFile]\(filePrefix, fileSuffix)
Creates a temporary file on disk.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#deleteFile]\(targetFile)
Removes a file from disk.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#deleteFolder]\(targetFolder, showWarning)
Deletes a folder from disk recursively.{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]\(targetFile)
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}[#getHomeDirectory]\()
Returns a JSFile instance corresponding to the home folder of the logged in used.{td}{tr}{tbody}{tbody}{tr}{td}[Date]{td}{td}[#getModificationDate]\(targetFile)
Returns the modification date of a file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#moveFile]\(sourceFile, destinationFile)
Moves the file from the source to the destination place.{td}{tr}{tbody}{tbody}{tr}{td}byte[]{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]\(file, charsetname)
Read all content from a text file.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#showDirectorySelectDialog]\(directory suggestion, dialog title text)
Shows a directory selector dialog.{td}{tr}{tbody}{tbody}{tr}{td}Object{td}{td}[#showFileOpenDialog]\(selectionMode(0=both,1=Files,2=Dirs), startDirectory(null=default/previous), multiselect(true/false), filterarray, callbackmethod, dialog title text)
Shows a file open dialog.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#showFileSaveDialog]\(fileName/dir suggestion, dialog title text)
Shows a file save dialog.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#writeFile]\(file, binary_data)
Writes data into a binary 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}[#writeXMLFile]\(file, xml_data)
Writes data into an XML file.{td}{tr}{tbody}{table}\\
{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=DCD3BC00-15AD-423D-ADE4-A880FFDB72F1}{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:DCD3BC00-15AD-423D-ADE4-A880FFDB72F1_des|text=|trigger=button}{sub-section}{sub-section:DCD3BC00-15AD-423D-ADE4-A880FFDB72F1_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}{tr:id=prs}{td}*Parameters*\\{sub-section:DCD3BC00-15AD-423D-ADE4-A880FFDB72F1_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DCD3BC00-15AD-423D-ADE4-A880FFDB72F1_prs|trigger=none}file
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:DCD3BC00-15AD-423D-ADE4-A880FFDB72F1_ret|text=|trigger=button}{sub-section}{sub-section:DCD3BC00-15AD-423D-ADE4-A880FFDB72F1_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DCD3BC00-15AD-423D-ADE4-A880FFDB72F1_see|text=|trigger=button}{sub-section}{sub-section:DCD3BC00-15AD-423D-ADE4-A880FFDB72F1_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DCD3BC00-15AD-423D-ADE4-A880FFDB72F1_see|text=|trigger=button}{sub-section}{sub-section:DCD3BC00-15AD-423D-ADE4-A880FFDB72F1_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:DCD3BC00-15AD-423D-ADE4-A880FFDB72F1_sam|text=|trigger=button}{sub-section}{sub-section:DCD3BC00-15AD-423D-ADE4-A880FFDB72F1_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile("story.txt");
if (f.canRead())
application.output("File can be read.");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=621134E9-532C-4DCC-B67C-74767680F449}{tr:id=name}{td}h6.copyFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}copyFile{span}{span:id=iets|style=float: left;}\(sourceFile, destinationFile){span}{td}{tr}{tr:id=des}{td}{sub-section:621134E9-532C-4DCC-B67C-74767680F449_des|text=|trigger=button}{sub-section}{sub-section:621134E9-532C-4DCC-B67C-74767680F449_des|trigger=none|class=sIndent}Copies the sourcefile to the destination file. Returns true if the copy succeeds, false if any error occurs.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:621134E9-532C-4DCC-B67C-74767680F449_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:621134E9-532C-4DCC-B67C-74767680F449_prs|trigger=none}sourceFile
destinationFile
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:621134E9-532C-4DCC-B67C-74767680F449_ret|text=|trigger=button}{sub-section}{sub-section:621134E9-532C-4DCC-B67C-74767680F449_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:621134E9-532C-4DCC-B67C-74767680F449_see|text=|trigger=button}{sub-section}{sub-section:621134E9-532C-4DCC-B67C-74767680F449_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:621134E9-532C-4DCC-B67C-74767680F449_see|text=|trigger=button}{sub-section}{sub-section:621134E9-532C-4DCC-B67C-74767680F449_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:621134E9-532C-4DCC-B67C-74767680F449_sam|text=|trigger=button}{sub-section}{sub-section:621134E9-532C-4DCC-B67C-74767680F449_sam|class=sIndent|trigger=none}{code:language=javascript}
// Copy based on file names.
if (!plugins.file.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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=C05E28FA-23C3-4D7E-8F94-AEAE44DBF082}{tr:id=name}{td}h6.copyFolder{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}copyFolder{span}{span:id=iets|style=float: left;}\(sourceFolder, destinationFolder){span}{td}{tr}{tr:id=des}{td}{sub-section:C05E28FA-23C3-4D7E-8F94-AEAE44DBF082_des|text=|trigger=button}{sub-section}{sub-section:C05E28FA-23C3-4D7E-8F94-AEAE44DBF082_des|trigger=none|class=sIndent}Copies the sourcefolder to the destination folder, recursively. Returns true if the copy succeeds, false if any error occurs.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:C05E28FA-23C3-4D7E-8F94-AEAE44DBF082_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:C05E28FA-23C3-4D7E-8F94-AEAE44DBF082_prs|trigger=none}sourceFolder
destinationFolder
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:C05E28FA-23C3-4D7E-8F94-AEAE44DBF082_ret|text=|trigger=button}{sub-section}{sub-section:C05E28FA-23C3-4D7E-8F94-AEAE44DBF082_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:C05E28FA-23C3-4D7E-8F94-AEAE44DBF082_see|text=|trigger=button}{sub-section}{sub-section:C05E28FA-23C3-4D7E-8F94-AEAE44DBF082_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:C05E28FA-23C3-4D7E-8F94-AEAE44DBF082_see|text=|trigger=button}{sub-section}{sub-section:C05E28FA-23C3-4D7E-8F94-AEAE44DBF082_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:C05E28FA-23C3-4D7E-8F94-AEAE44DBF082_sam|text=|trigger=button}{sub-section}{sub-section:C05E28FA-23C3-4D7E-8F94-AEAE44DBF082_sam|class=sIndent|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.createFile("stories_copy_2");
if (!plugins.file.copyFolder(d, dcopy))
application.output("Folder copy failed.");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=92E77024-CC2C-4DD0-9F95-4D571A7C97F5}{tr:id=name}{td}h6.createFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}createFile{span}{span:id=iets|style=float: left;}\(targetFile){span}{td}{tr}{tr:id=des}{td}{sub-section:92E77024-CC2C-4DD0-9F95-4D571A7C97F5_des|text=|trigger=button}{sub-section}{sub-section:92E77024-CC2C-4DD0-9F95-4D571A7C97F5_des|trigger=none|class=sIndent}Creates a JSFile instance. Does not create the file on disk.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:92E77024-CC2C-4DD0-9F95-4D571A7C97F5_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:92E77024-CC2C-4DD0-9F95-4D571A7C97F5_prs|trigger=none}targetFile
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:92E77024-CC2C-4DD0-9F95-4D571A7C97F5_ret|text=|trigger=button}{sub-section}{sub-section:92E77024-CC2C-4DD0-9F95-4D571A7C97F5_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:92E77024-CC2C-4DD0-9F95-4D571A7C97F5_see|text=|trigger=button}{sub-section}{sub-section:92E77024-CC2C-4DD0-9F95-4D571A7C97F5_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:92E77024-CC2C-4DD0-9F95-4D571A7C97F5_see|text=|trigger=button}{sub-section}{sub-section:92E77024-CC2C-4DD0-9F95-4D571A7C97F5_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:92E77024-CC2C-4DD0-9F95-4D571A7C97F5_sam|text=|trigger=button}{sub-section}{sub-section:92E77024-CC2C-4DD0-9F95-4D571A7C97F5_sam|class=sIndent|trigger=none}{code:language=javascript}
// Create the JSFile instance based on the file name.
var f = plugins.file.createFile("newfile.txt");
// Create the file on disk.
if (!f.createNewFile())
application.output("The file could not be created.");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=2B131F75-7D26-49C9-8654-468089DC9776}{tr:id=name}{td}h6.createFolder{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}createFolder{span}{span:id=iets|style=float: left;}\(targetFolder){span}{td}{tr}{tr:id=des}{td}{sub-section:2B131F75-7D26-49C9-8654-468089DC9776_des|text=|trigger=button}{sub-section}{sub-section:2B131F75-7D26-49C9-8654-468089DC9776_des|trigger=none|class=sIndent}Creates a folder on disk. Returns true if the folder is successfully created, false if any error occurs.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:2B131F75-7D26-49C9-8654-468089DC9776_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:2B131F75-7D26-49C9-8654-468089DC9776_prs|trigger=none}targetFolder
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:2B131F75-7D26-49C9-8654-468089DC9776_ret|text=|trigger=button}{sub-section}{sub-section:2B131F75-7D26-49C9-8654-468089DC9776_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:2B131F75-7D26-49C9-8654-468089DC9776_see|text=|trigger=button}{sub-section}{sub-section:2B131F75-7D26-49C9-8654-468089DC9776_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:2B131F75-7D26-49C9-8654-468089DC9776_see|text=|trigger=button}{sub-section}{sub-section:2B131F75-7D26-49C9-8654-468089DC9776_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:2B131F75-7D26-49C9-8654-468089DC9776_sam|text=|trigger=button}{sub-section}{sub-section:2B131F75-7D26-49C9-8654-468089DC9776_sam|class=sIndent|trigger=none}{code:language=javascript}
var d = plugins.file.convertToJSFile("newfolder");
if (!plugins.file.createFolder(d))
application.output("Folder could not be created.");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=14068D80-3482-476E-A5A8-A708FCA496EF}{tr:id=name}{td}h6.createTempFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}createTempFile{span}{span:id=iets|style=float: left;}\(filePrefix, fileSuffix){span}{td}{tr}{tr:id=des}{td}{sub-section:14068D80-3482-476E-A5A8-A708FCA496EF_des|text=|trigger=button}{sub-section}{sub-section:14068D80-3482-476E-A5A8-A708FCA496EF_des|trigger=none|class=sIndent}Creates a temporary file on disk. A prefix and an extension are specified and they will be part of the file name.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:14068D80-3482-476E-A5A8-A708FCA496EF_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:14068D80-3482-476E-A5A8-A708FCA496EF_prs|trigger=none}filePrefix
fileSuffix
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:14068D80-3482-476E-A5A8-A708FCA496EF_ret|text=|trigger=button}{sub-section}{sub-section:14068D80-3482-476E-A5A8-A708FCA496EF_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:14068D80-3482-476E-A5A8-A708FCA496EF_see|text=|trigger=button}{sub-section}{sub-section:14068D80-3482-476E-A5A8-A708FCA496EF_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:14068D80-3482-476E-A5A8-A708FCA496EF_see|text=|trigger=button}{sub-section}{sub-section:14068D80-3482-476E-A5A8-A708FCA496EF_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:14068D80-3482-476E-A5A8-A708FCA496EF_sam|text=|trigger=button}{sub-section}{sub-section:14068D80-3482-476E-A5A8-A708FCA496EF_sam|class=sIndent|trigger=none}{code:language=javascript}
var tempFile = plugins.file.createTempFile('myfile','.txt');
application.output('Temporary file created as: ' + tempFile.getAbsolutePath());
plugins.file.writeTXTFile(tempFile, 'abcdefg');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=BA4D2870-37A9-4B11-B6B9-B78269328F0D}{tr:id=name}{td}h6.deleteFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}deleteFile{span}{span:id=iets|style=float: left;}\(targetFile){span}{td}{tr}{tr:id=des}{td}{sub-section:BA4D2870-37A9-4B11-B6B9-B78269328F0D_des|text=|trigger=button}{sub-section}{sub-section:BA4D2870-37A9-4B11-B6B9-B78269328F0D_des|trigger=none|class=sIndent}Removes a file from disk. Returns true on success, false otherwise.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:BA4D2870-37A9-4B11-B6B9-B78269328F0D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:BA4D2870-37A9-4B11-B6B9-B78269328F0D_prs|trigger=none}targetFile
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:BA4D2870-37A9-4B11-B6B9-B78269328F0D_ret|text=|trigger=button}{sub-section}{sub-section:BA4D2870-37A9-4B11-B6B9-B78269328F0D_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:BA4D2870-37A9-4B11-B6B9-B78269328F0D_see|text=|trigger=button}{sub-section}{sub-section:BA4D2870-37A9-4B11-B6B9-B78269328F0D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:BA4D2870-37A9-4B11-B6B9-B78269328F0D_see|text=|trigger=button}{sub-section}{sub-section:BA4D2870-37A9-4B11-B6B9-B78269328F0D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:BA4D2870-37A9-4B11-B6B9-B78269328F0D_sam|text=|trigger=button}{sub-section}{sub-section:BA4D2870-37A9-4B11-B6B9-B78269328F0D_sam|class=sIndent|trigger=none}{code:language=javascript}
if (plugins.file.deleteFile('story.txt'))
application.output('File deleted.');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=EAEC4528-CFE6-468F-BC56-F0F843A7E308}{tr:id=name}{td}h6.deleteFolder{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}deleteFolder{span}{span:id=iets|style=float: left;}\(targetFolder, showWarning){span}{td}{tr}{tr:id=des}{td}{sub-section:EAEC4528-CFE6-468F-BC56-F0F843A7E308_des|text=|trigger=button}{sub-section}{sub-section:EAEC4528-CFE6-468F-BC56-F0F843A7E308_des|trigger=none|class=sIndent}Deletes a folder from disk recursively. Returns true on success, false otherwise. If the second parameter is set to true, then a warning will be issued to the user before actually removing the folder.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:EAEC4528-CFE6-468F-BC56-F0F843A7E308_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:EAEC4528-CFE6-468F-BC56-F0F843A7E308_prs|trigger=none}targetFolder
showWarning
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:EAEC4528-CFE6-468F-BC56-F0F843A7E308_ret|text=|trigger=button}{sub-section}{sub-section:EAEC4528-CFE6-468F-BC56-F0F843A7E308_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:EAEC4528-CFE6-468F-BC56-F0F843A7E308_see|text=|trigger=button}{sub-section}{sub-section:EAEC4528-CFE6-468F-BC56-F0F843A7E308_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:EAEC4528-CFE6-468F-BC56-F0F843A7E308_see|text=|trigger=button}{sub-section}{sub-section:EAEC4528-CFE6-468F-BC56-F0F843A7E308_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:EAEC4528-CFE6-468F-BC56-F0F843A7E308_sam|text=|trigger=button}{sub-section}{sub-section:EAEC4528-CFE6-468F-BC56-F0F843A7E308_sam|class=sIndent|trigger=none}{code:language=javascript}
if (plugins.file.deleteFolder('stories', true))
application.output('Folder deleted.');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=8F245643-66DF-4CD3-9A92-AEDFB850CC61}{tr:id=name}{td}h6.getDesktopFolder{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}getDesktopFolder{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:8F245643-66DF-4CD3-9A92-AEDFB850CC61_des|text=|trigger=button}{sub-section}{sub-section:8F245643-66DF-4CD3-9A92-AEDFB850CC61_des|trigger=none|class=sIndent}Returns a JSFile instance that corresponds to the Desktop folder of the currently logged in user.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:8F245643-66DF-4CD3-9A92-AEDFB850CC61_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8F245643-66DF-4CD3-9A92-AEDFB850CC61_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:8F245643-66DF-4CD3-9A92-AEDFB850CC61_ret|text=|trigger=button}{sub-section}{sub-section:8F245643-66DF-4CD3-9A92-AEDFB850CC61_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8F245643-66DF-4CD3-9A92-AEDFB850CC61_see|text=|trigger=button}{sub-section}{sub-section:8F245643-66DF-4CD3-9A92-AEDFB850CC61_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8F245643-66DF-4CD3-9A92-AEDFB850CC61_see|text=|trigger=button}{sub-section}{sub-section:8F245643-66DF-4CD3-9A92-AEDFB850CC61_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8F245643-66DF-4CD3-9A92-AEDFB850CC61_sam|text=|trigger=button}{sub-section}{sub-section:8F245643-66DF-4CD3-9A92-AEDFB850CC61_sam|class=sIndent|trigger=none}{code:language=javascript}
var d = plugins.file.getDesktopFolder();
application.output('desktop folder is: ' + d.getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=DAD2BB17-315E-4740-B877-90C291FEBB80}{tr:id=name}{td}h6.getDiskList{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getDiskList{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:DAD2BB17-315E-4740-B877-90C291FEBB80_des|text=|trigger=button}{sub-section}{sub-section:DAD2BB17-315E-4740-B877-90C291FEBB80_des|trigger=none|class=sIndent}Returns an Array of JSFile instances correponding to the file system root folders.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:DAD2BB17-315E-4740-B877-90C291FEBB80_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DAD2BB17-315E-4740-B877-90C291FEBB80_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:DAD2BB17-315E-4740-B877-90C291FEBB80_ret|text=|trigger=button}{sub-section}{sub-section:DAD2BB17-315E-4740-B877-90C291FEBB80_ret|trigger=none|class=sIndent}[JSFile]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DAD2BB17-315E-4740-B877-90C291FEBB80_see|text=|trigger=button}{sub-section}{sub-section:DAD2BB17-315E-4740-B877-90C291FEBB80_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DAD2BB17-315E-4740-B877-90C291FEBB80_see|text=|trigger=button}{sub-section}{sub-section:DAD2BB17-315E-4740-B877-90C291FEBB80_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:DAD2BB17-315E-4740-B877-90C291FEBB80_sam|text=|trigger=button}{sub-section}{sub-section:DAD2BB17-315E-4740-B877-90C291FEBB80_sam|class=sIndent|trigger=none}{code:language=javascript}
var roots = plugins.file.getDiskList();
for (var i = 0; i < roots.length; i++)
application.output(roots[i].getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=390CB14F-2DAB-4148-A7BB-9DDBA2CD111F}{tr:id=name}{td}h6.getFileSize{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getFileSize{span}{span:id=iets|style=float: left;}\(targetFile){span}{td}{tr}{tr:id=des}{td}{sub-section:390CB14F-2DAB-4148-A7BB-9DDBA2CD111F_des|text=|trigger=button}{sub-section}{sub-section:390CB14F-2DAB-4148-A7BB-9DDBA2CD111F_des|trigger=none|class=sIndent}Returns the size of the specified file.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:390CB14F-2DAB-4148-A7BB-9DDBA2CD111F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:390CB14F-2DAB-4148-A7BB-9DDBA2CD111F_prs|trigger=none}targetFile
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:390CB14F-2DAB-4148-A7BB-9DDBA2CD111F_ret|text=|trigger=button}{sub-section}{sub-section:390CB14F-2DAB-4148-A7BB-9DDBA2CD111F_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:390CB14F-2DAB-4148-A7BB-9DDBA2CD111F_see|text=|trigger=button}{sub-section}{sub-section:390CB14F-2DAB-4148-A7BB-9DDBA2CD111F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:390CB14F-2DAB-4148-A7BB-9DDBA2CD111F_see|text=|trigger=button}{sub-section}{sub-section:390CB14F-2DAB-4148-A7BB-9DDBA2CD111F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:390CB14F-2DAB-4148-A7BB-9DDBA2CD111F_sam|text=|trigger=button}{sub-section}{sub-section:390CB14F-2DAB-4148-A7BB-9DDBA2CD111F_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('story.txt');
application.output('file size: ' + plugins.file.getFileSize(f));
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0C908C1E-84B3-4399-9A5F-7C4B5A2DA969}{tr:id=name}{td}h6.getFolderContents{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getFolderContents{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:0C908C1E-84B3-4399-9A5F-7C4B5A2DA969_des|text=|trigger=button}{sub-section}{sub-section:0C908C1E-84B3-4399-9A5F-7C4B5A2DA969_des|trigger=none|class=sIndent}Returns 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}{tr:id=prs}{td}*Parameters*\\{sub-section:0C908C1E-84B3-4399-9A5F-7C4B5A2DA969_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0C908C1E-84B3-4399-9A5F-7C4B5A2DA969_prs|trigger=none}targetFolder
\[fileFilter\]
\[fileOption(1=files,2=dirs)\]
\[visibleOption(1=visible,2=nonvisible)\]
\[lockedOption(1=locked,2=nonlocked)\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:0C908C1E-84B3-4399-9A5F-7C4B5A2DA969_ret|text=|trigger=button}{sub-section}{sub-section:0C908C1E-84B3-4399-9A5F-7C4B5A2DA969_ret|trigger=none|class=sIndent}[JSFile]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0C908C1E-84B3-4399-9A5F-7C4B5A2DA969_see|text=|trigger=button}{sub-section}{sub-section:0C908C1E-84B3-4399-9A5F-7C4B5A2DA969_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0C908C1E-84B3-4399-9A5F-7C4B5A2DA969_see|text=|trigger=button}{sub-section}{sub-section:0C908C1E-84B3-4399-9A5F-7C4B5A2DA969_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0C908C1E-84B3-4399-9A5F-7C4B5A2DA969_sam|text=|trigger=button}{sub-section}{sub-section:0C908C1E-84B3-4399-9A5F-7C4B5A2DA969_sam|class=sIndent|trigger=none}{code:language=javascript}
var files = plugins.file.getFolderContents('stories', '.txt');
for (var i=0; i<files.length; i++)
application.output(files[i].getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D31B88E9-5EDB-49B2-B9DF-7759BE0DD464}{tr:id=name}{td}h6.getHomeDirectory{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}getHomeDirectory{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:D31B88E9-5EDB-49B2-B9DF-7759BE0DD464_des|text=|trigger=button}{sub-section}{sub-section:D31B88E9-5EDB-49B2-B9DF-7759BE0DD464_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=prs}{td}*Parameters*\\{sub-section:D31B88E9-5EDB-49B2-B9DF-7759BE0DD464_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D31B88E9-5EDB-49B2-B9DF-7759BE0DD464_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:D31B88E9-5EDB-49B2-B9DF-7759BE0DD464_ret|text=|trigger=button}{sub-section}{sub-section:D31B88E9-5EDB-49B2-B9DF-7759BE0DD464_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D31B88E9-5EDB-49B2-B9DF-7759BE0DD464_see|text=|trigger=button}{sub-section}{sub-section:D31B88E9-5EDB-49B2-B9DF-7759BE0DD464_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D31B88E9-5EDB-49B2-B9DF-7759BE0DD464_see|text=|trigger=button}{sub-section}{sub-section:D31B88E9-5EDB-49B2-B9DF-7759BE0DD464_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D31B88E9-5EDB-49B2-B9DF-7759BE0DD464_sam|text=|trigger=button}{sub-section}{sub-section:D31B88E9-5EDB-49B2-B9DF-7759BE0DD464_sam|class=sIndent|trigger=none}{code:language=javascript}
var d = plugins.file.getHomeDirectory();
application.output('home folder: ' + d.getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=87032485-9B32-4A14-831E-E1DF2D0A9CE1}{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;}\(targetFile){span}{td}{tr}{tr:id=des}{td}{sub-section:87032485-9B32-4A14-831E-E1DF2D0A9CE1_des|text=|trigger=button}{sub-section}{sub-section:87032485-9B32-4A14-831E-E1DF2D0A9CE1_des|trigger=none|class=sIndent}Returns the modification date of a file.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:87032485-9B32-4A14-831E-E1DF2D0A9CE1_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:87032485-9B32-4A14-831E-E1DF2D0A9CE1_prs|trigger=none}targetFile
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:87032485-9B32-4A14-831E-E1DF2D0A9CE1_ret|text=|trigger=button}{sub-section}{sub-section:87032485-9B32-4A14-831E-E1DF2D0A9CE1_ret|trigger=none|class=sIndent}[Date]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:87032485-9B32-4A14-831E-E1DF2D0A9CE1_see|text=|trigger=button}{sub-section}{sub-section:87032485-9B32-4A14-831E-E1DF2D0A9CE1_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:87032485-9B32-4A14-831E-E1DF2D0A9CE1_see|text=|trigger=button}{sub-section}{sub-section:87032485-9B32-4A14-831E-E1DF2D0A9CE1_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:87032485-9B32-4A14-831E-E1DF2D0A9CE1_sam|text=|trigger=button}{sub-section}{sub-section:87032485-9B32-4A14-831E-E1DF2D0A9CE1_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('story.txt');
application.output('last changed: ' + plugins.file.getModificationDate(f));
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0D46B6AE-D657-4B22-B8E1-3883D4248F55}{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;}\(sourceFile, destinationFile){span}{td}{tr}{tr:id=des}{td}{sub-section:0D46B6AE-D657-4B22-B8E1-3883D4248F55_des|text=|trigger=button}{sub-section}{sub-section:0D46B6AE-D657-4B22-B8E1-3883D4248F55_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}{tr:id=prs}{td}*Parameters*\\{sub-section:0D46B6AE-D657-4B22-B8E1-3883D4248F55_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0D46B6AE-D657-4B22-B8E1-3883D4248F55_prs|trigger=none}sourceFile
destinationFile
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:0D46B6AE-D657-4B22-B8E1-3883D4248F55_ret|text=|trigger=button}{sub-section}{sub-section:0D46B6AE-D657-4B22-B8E1-3883D4248F55_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0D46B6AE-D657-4B22-B8E1-3883D4248F55_see|text=|trigger=button}{sub-section}{sub-section:0D46B6AE-D657-4B22-B8E1-3883D4248F55_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0D46B6AE-D657-4B22-B8E1-3883D4248F55_see|text=|trigger=button}{sub-section}{sub-section:0D46B6AE-D657-4B22-B8E1-3883D4248F55_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0D46B6AE-D657-4B22-B8E1-3883D4248F55_sam|text=|trigger=button}{sub-section}{sub-section:0D46B6AE-D657-4B22-B8E1-3883D4248F55_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=6DA45605-D2CF-4548-A4D9-FD73CC312191}{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:6DA45605-D2CF-4548-A4D9-FD73CC312191_des|text=|trigger=button}{sub-section}{sub-section:6DA45605-D2CF-4548-A4D9-FD73CC312191_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){sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:6DA45605-D2CF-4548-A4D9-FD73CC312191_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6DA45605-D2CF-4548-A4D9-FD73CC312191_prs|trigger=none}\[file\]
\[size\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:6DA45605-D2CF-4548-A4D9-FD73CC312191_ret|text=|trigger=button}{sub-section}{sub-section:6DA45605-D2CF-4548-A4D9-FD73CC312191_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6DA45605-D2CF-4548-A4D9-FD73CC312191_see|text=|trigger=button}{sub-section}{sub-section:6DA45605-D2CF-4548-A4D9-FD73CC312191_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6DA45605-D2CF-4548-A4D9-FD73CC312191_see|text=|trigger=button}{sub-section}{sub-section:6DA45605-D2CF-4548-A4D9-FD73CC312191_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6DA45605-D2CF-4548-A4D9-FD73CC312191_sam|text=|trigger=button}{sub-section}{sub-section:6DA45605-D2CF-4548-A4D9-FD73CC312191_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D140E376-2B9B-4DBD-806B-C4AF051E40EA}{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:D140E376-2B9B-4DBD-806B-C4AF051E40EA_des|text=|trigger=button}{sub-section}{sub-section:D140E376-2B9B-4DBD-806B-C4AF051E40EA_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){sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:D140E376-2B9B-4DBD-806B-C4AF051E40EA_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D140E376-2B9B-4DBD-806B-C4AF051E40EA_prs|trigger=none}\[file\]
\[charsetname\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:D140E376-2B9B-4DBD-806B-C4AF051E40EA_ret|text=|trigger=button}{sub-section}{sub-section:D140E376-2B9B-4DBD-806B-C4AF051E40EA_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D140E376-2B9B-4DBD-806B-C4AF051E40EA_see|text=|trigger=button}{sub-section}{sub-section:D140E376-2B9B-4DBD-806B-C4AF051E40EA_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D140E376-2B9B-4DBD-806B-C4AF051E40EA_see|text=|trigger=button}{sub-section}{sub-section:D140E376-2B9B-4DBD-806B-C4AF051E40EA_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D140E376-2B9B-4DBD-806B-C4AF051E40EA_sam|text=|trigger=button}{sub-section}{sub-section:D140E376-2B9B-4DBD-806B-C4AF051E40EA_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=33BD0338-6EC5-472C-A9E6-7D67BBA9E616}{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 suggestion, dialog title text){span}{td}{tr}{tr:id=des}{td}{sub-section:33BD0338-6EC5-472C-A9E6-7D67BBA9E616_des|text=|trigger=button}{sub-section}{sub-section:33BD0338-6EC5-472C-A9E6-7D67BBA9E616_des|trigger=none|class=sIndent}Shows a directory selector dialog.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:33BD0338-6EC5-472C-A9E6-7D67BBA9E616_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:33BD0338-6EC5-472C-A9E6-7D67BBA9E616_prs|trigger=none}\[directory suggestion\]
\[dialog title text\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:33BD0338-6EC5-472C-A9E6-7D67BBA9E616_ret|text=|trigger=button}{sub-section}{sub-section:33BD0338-6EC5-472C-A9E6-7D67BBA9E616_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:33BD0338-6EC5-472C-A9E6-7D67BBA9E616_see|text=|trigger=button}{sub-section}{sub-section:33BD0338-6EC5-472C-A9E6-7D67BBA9E616_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:33BD0338-6EC5-472C-A9E6-7D67BBA9E616_see|text=|trigger=button}{sub-section}{sub-section:33BD0338-6EC5-472C-A9E6-7D67BBA9E616_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:33BD0338-6EC5-472C-A9E6-7D67BBA9E616_sam|text=|trigger=button}{sub-section}{sub-section:33BD0338-6EC5-472C-A9E6-7D67BBA9E616_sam|class=sIndent|trigger=none}{code:language=javascript}
var dir = plugins.file.showDirectorySelectDialog();
application.output("you've selected folder: " + dir.getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B4416BD9-E281-4444-A73E-8F6E8F5BD055}{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(0=both,1=Files,2=Dirs), startDirectory(null=default/previous), multiselect(true/false), filterarray, callbackmethod, dialog title text){span}{td}{tr}{tr:id=des}{td}{sub-section:B4416BD9-E281-4444-A73E-8F6E8F5BD055_des|text=|trigger=button}{sub-section}{sub-section:B4416BD9-E281-4444-A73E-8F6E8F5BD055_des|trigger=none|class=sIndent}Shows a file open dialog. Filters can be applied on what type of files can be selected. (Web Enabled){sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:B4416BD9-E281-4444-A73E-8F6E8F5BD055_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B4416BD9-E281-4444-A73E-8F6E8F5BD055_prs|trigger=none}\[selectionMode(0=both,1=Files,2=Dirs)\]
\[startDirectory(null=default/previous)\]
\[multiselect(true/false)\]
\[filterarray\]
\[callbackmethod\]
\[dialog title text\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:B4416BD9-E281-4444-A73E-8F6E8F5BD055_ret|text=|trigger=button}{sub-section}{sub-section:B4416BD9-E281-4444-A73E-8F6E8F5BD055_ret|trigger=none|class=sIndent}Object{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B4416BD9-E281-4444-A73E-8F6E8F5BD055_see|text=|trigger=button}{sub-section}{sub-section:B4416BD9-E281-4444-A73E-8F6E8F5BD055_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B4416BD9-E281-4444-A73E-8F6E8F5BD055_see|text=|trigger=button}{sub-section}{sub-section:B4416BD9-E281-4444-A73E-8F6E8F5BD055_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B4416BD9-E281-4444-A73E-8F6E8F5BD055_sam|text=|trigger=button}{sub-section}{sub-section:B4416BD9-E281-4444-A73E-8F6E8F5BD055_sam|class=sIndent|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")').
var file = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF","jpg","gif"));
application.output("you've selected file: " + file.getAbsolutePath());
//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)
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=7921CF41-ECC5-4662-936F-8A7A63D4D326}{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;}\(fileName/dir suggestion, dialog title text){span}{td}{tr}{tr:id=des}{td}{sub-section:7921CF41-ECC5-4662-936F-8A7A63D4D326_des|text=|trigger=button}{sub-section}{sub-section:7921CF41-ECC5-4662-936F-8A7A63D4D326_des|trigger=none|class=sIndent}Shows a file save dialog.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:7921CF41-ECC5-4662-936F-8A7A63D4D326_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:7921CF41-ECC5-4662-936F-8A7A63D4D326_prs|trigger=none}\[fileName/dir suggestion\]
\[dialog title text\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:7921CF41-ECC5-4662-936F-8A7A63D4D326_ret|text=|trigger=button}{sub-section}{sub-section:7921CF41-ECC5-4662-936F-8A7A63D4D326_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:7921CF41-ECC5-4662-936F-8A7A63D4D326_see|text=|trigger=button}{sub-section}{sub-section:7921CF41-ECC5-4662-936F-8A7A63D4D326_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:7921CF41-ECC5-4662-936F-8A7A63D4D326_see|text=|trigger=button}{sub-section}{sub-section:7921CF41-ECC5-4662-936F-8A7A63D4D326_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:7921CF41-ECC5-4662-936F-8A7A63D4D326_sam|text=|trigger=button}{sub-section}{sub-section:7921CF41-ECC5-4662-936F-8A7A63D4D326_sam|class=sIndent|trigger=none}{code:language=javascript}
var file = plugins.file.showFileSaveDialog();
application.output("you've selected file: " + file.getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=A9EFCC2B-B8F9-4B60-9669-AF9B4EFDC495}{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;}\(file, binary_data){span}{td}{tr}{tr:id=des}{td}{sub-section:A9EFCC2B-B8F9-4B60-9669-AF9B4EFDC495_des|text=|trigger=button}{sub-section}{sub-section:A9EFCC2B-B8F9-4B60-9669-AF9B4EFDC495_des|trigger=none|class=sIndent}Writes data into a binary file. (Web Enabled){sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:A9EFCC2B-B8F9-4B60-9669-AF9B4EFDC495_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A9EFCC2B-B8F9-4B60-9669-AF9B4EFDC495_prs|trigger=none}file
binary_data
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:A9EFCC2B-B8F9-4B60-9669-AF9B4EFDC495_ret|text=|trigger=button}{sub-section}{sub-section:A9EFCC2B-B8F9-4B60-9669-AF9B4EFDC495_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A9EFCC2B-B8F9-4B60-9669-AF9B4EFDC495_see|text=|trigger=button}{sub-section}{sub-section:A9EFCC2B-B8F9-4B60-9669-AF9B4EFDC495_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A9EFCC2B-B8F9-4B60-9669-AF9B4EFDC495_see|text=|trigger=button}{sub-section}{sub-section:A9EFCC2B-B8F9-4B60-9669-AF9B4EFDC495_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A9EFCC2B-B8F9-4B60-9669-AF9B4EFDC495_sam|text=|trigger=button}{sub-section}{sub-section:A9EFCC2B-B8F9-4B60-9669-AF9B4EFDC495_sam|class=sIndent|trigger=none}{code:language=javascript}
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.');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=293D1B5E-8910-4D0C-AA5A-977B282F8EED}{tr:id=name}{td}h6.writeTXTFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}writeTXTFile{span}{span:id=iets|style=float: left;}\(file, text_data, charsetname){span}{td}{tr}{tr:id=des}{td}{sub-section:293D1B5E-8910-4D0C-AA5A-977B282F8EED_des|text=|trigger=button}{sub-section}{sub-section:293D1B5E-8910-4D0C-AA5A-977B282F8EED_des|trigger=none|class=sIndent}Writes data into a text file. (Web Enabled){sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:293D1B5E-8910-4D0C-AA5A-977B282F8EED_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:293D1B5E-8910-4D0C-AA5A-977B282F8EED_prs|trigger=none}file
text_data
\[charsetname\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:293D1B5E-8910-4D0C-AA5A-977B282F8EED_ret|text=|trigger=button}{sub-section}{sub-section:293D1B5E-8910-4D0C-AA5A-977B282F8EED_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:293D1B5E-8910-4D0C-AA5A-977B282F8EED_see|text=|trigger=button}{sub-section}{sub-section:293D1B5E-8910-4D0C-AA5A-977B282F8EED_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:293D1B5E-8910-4D0C-AA5A-977B282F8EED_see|text=|trigger=button}{sub-section}{sub-section:293D1B5E-8910-4D0C-AA5A-977B282F8EED_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:293D1B5E-8910-4D0C-AA5A-977B282F8EED_sam|text=|trigger=button}{sub-section}{sub-section:293D1B5E-8910-4D0C-AA5A-977B282F8EED_sam|class=sIndent|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
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=07D0BB77-4135-420F-A09C-1D97E056B7EC}{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){span}{td}{tr}{tr:id=des}{td}{sub-section:07D0BB77-4135-420F-A09C-1D97E056B7EC_des|text=|trigger=button}{sub-section}{sub-section:07D0BB77-4135-420F-A09C-1D97E056B7EC_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){sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:07D0BB77-4135-420F-A09C-1D97E056B7EC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:07D0BB77-4135-420F-A09C-1D97E056B7EC_prs|trigger=none}file
xml_data
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:07D0BB77-4135-420F-A09C-1D97E056B7EC_ret|text=|trigger=button}{sub-section}{sub-section:07D0BB77-4135-420F-A09C-1D97E056B7EC_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:07D0BB77-4135-420F-A09C-1D97E056B7EC_see|text=|trigger=button}{sub-section}{sub-section:07D0BB77-4135-420F-A09C-1D97E056B7EC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:07D0BB77-4135-420F-A09C-1D97E056B7EC_see|text=|trigger=button}{sub-section}{sub-section:07D0BB77-4135-420F-A09C-1D97E056B7EC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:07D0BB77-4135-420F-A09C-1D97E056B7EC_sam|text=|trigger=button}{sub-section}{sub-section:07D0BB77-4135-420F-A09C-1D97E056B7EC_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Cache
index
true
refresh
100d
showRefresh
true
id
doc
title
Refresh page
showDate
true
retry
Enable
servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientservoy sSummary12%30%58%height: 30px;3Methods SummaryAppends a string given in parameter to a file, using default platform encoding.Appends a string given in parameter to a file, using the specified encoding.Appends a string given in parameter to a file, using default platform encoding.Appends a string given in parameter to a file, using the specified encoding.Returns a JSFile instance corresponding to an alternative representation of a file (for example a string).Convenience return to get a JSFile representation of a server file based on its path.Copies the source file to the destination file.Copies the sourcefolder to the destination folder, recursively.Creates a JSFile instance.Creates the folder by the given pathname, including anynecessary but nonexistent parent folders.Creates a temporary file on disk.Removes a file from disk.Deletes a folder from disk recursively.Returns the default upload location path of the server.Returns a JSFile instance that corresponds to the Desktop folder of the currently logged in user.Returns an Array of JSFile instances correponding to the file system root folders.Returns the size of the specified file.Returns an array of JSFile instances corresponding to content of the specified folder.Returns an array of JSFile instances corresponding to content of the specified folder.Returns an array of JSFile instances corresponding to content of the specified folder.Returns an array of JSFile instances corresponding to content of the specified folder.Returns an array of JSFile instances corresponding to content of the specified folder.Returns an array of JSFile instances corresponding to content of the specified folder.Returns an array of JSFile instances corresponding to content of the specified folder.Returns an array of JSFile instances corresponding to content of the specified folder.Returns an array of JSFile instances corresponding to content of the specified folder.Returns an array of JSFile instances corresponding to content of the specified folder.Returns a JSFile instance corresponding to the home folder of the logged in used.Returns the modification date of a file.Returns an array of JSFile instances corresponding to content of the specified folder on the server side.Returns an array of JSFile instances corresponding to content of the specified folder on the server side.Returns an array of JSFile instances corresponding to content of the specified folder on the server side.Returns an array of JSFile instances corresponding to content of the specified folder on the server side.Returns an array of JSFile instances corresponding to content of the specified folder on the server side.Returns an array of JSFile instances corresponding to content of the specified folder on the server side.Returns an array of JSFile instances corresponding to content of the specified folder on the server side.Returns an array of JSFile instances corresponding to content of the specified folder on the server side.Returns an array of JSFile instances corresponding to content of the specified folder on the server side.Returns an array of JSFile instances corresponding to content of the specified folder on the server side.Get a url from a remote file that can be used to download the file in a browser.Get a url from a remote file that can be used to download the file in a browser.Moves the file from the source to the destination place.Opens the given local file.Opens the given local file.Opens the given data as a file.Opens the given data as a file.Reads all or part of the content from a binary file.Reads all or part of the content from a binary file.Reads all or part of the content from a binary file.Reads all or part of the content from a binary file.Reads all or part of the content from a binary file.Read all content from a text file.Read all content from a text file.Read all content from a text file.Read all content from a text file.Read all content from a text file.Shows a directory selector dialog.Shows a directory selector dialog.Shows a directory selector dialog.Shows a directory selector dialog.Shows a directory selector dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file open dialog.Shows a file save dialog.Shows a file save dialog.Shows a file save dialog.Shows a file save dialog.Shows a file save dialog.voidStream the given file(path) to the browser with content-disposition:attachment This will not load in the file fully into memory but only stream it right from disk.voidString the given file(path) to the browser you can provide the content disposition how this should be send (inline or as an attachment) This will not load in the file fully into memory but only stream it right from disk.voidString the given file(path) to the browser you can provide the content disposition how this should be send (inline or as an attachment) This will not load in the file fully into memory but only stream it right from disk.Stream 1 or more files from the server to the client.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.Overloaded method, only defines file(s) to be streamedOverloaded method, defines file(s) to be streamed and a callback functionOverloaded method, defines file(s) to be streamed, a callback function and file name(s) to use on the serverOverloaded method, defines file(s) to be streamed and a callback functionvoidIf the client's solution is closed, the file given to this method wil be deleted.Writes the given file to disk.Writes the given file to disk.Writes the given file to disk.Writes the given file to disk.Writes data into a text file.Writes data into a text file.Writes data into a text file.Writes data into a text file.Writes data into a text file.Writes data into a text file.Writes data into an XML file.Writes data into an XML file.Writes data into an XML file.Writes data into an XML file.functionservoy sDetail2100%height:30px2Methods DetailsappendToTXTFilename
appendToTXTFile(file, text)
dessIndent
Appends a string given in parameter to a file, using default platform encoding.
prs
Parameters
sIndentfilea local JSFiletextthe text to append to the fileret
Returns
sIndent true if appending workedclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowappendToTXTFilename
appendToTXTFile(file, text, encoding)
dessIndent
Appends a string given in parameter to a file, using the specified encoding.
prs
Parameters
sIndentfilea local JSFiletextthe text to append to the fileencodingthe encoding to useret
Returns
sIndent true if appending workedclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowappendToTXTFilename
appendToTXTFile(file, text)
dessIndent
Appends a string given in parameter to a file, using default platform encoding.
prs
Parameters
sIndentfilethe file path as a Stringtextthe text to append to the fileret
Returns
sIndent true if appending workedclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowappendToTXTFilename
appendToTXTFile(file, text, encoding)
dessIndent
Appends a string given in parameter to a file, using the specified encoding.
prs
Parameters
sIndentfilethe file path as a Stringtextthe text to append to the fileencodingthe encoding to useret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowconvertToJSFilename
convertToJSFile(file)
dessIndent
Returns a JSFile instance corresponding to an alternative representation of a file (for example a string).
Convenience return to get a JSFile representation of a server file based on its path.
prs
Parameters
sIndentpaththe path representing a file on the server (should start with "/")ret
Returns
sIndent the JSFileclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowcopyFilename
copyFile(source, destination)
dessIndent
Copies the source file to the destination file. Returns true if the copy succeeds, false if any error occurs.
prs
Parameters
sIndentsource ;destination ;ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowcopyFoldername
copyFolder(source, destination)
dessIndent
Copies the sourcefolder to the destination folder, recursively. Returns true if the copy succeeds, false if any error occurs.
prs
Parameters
sIndentsource ;destination ;ret
Returns
sIndent success booleanclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowcreateFilename
createFile(targetFile)
dessIndent
Creates a JSFile instance. Does not create the file on disk.
prs
Parameters
sIndenttargetFile ;ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowcreateFoldername
createFolder(destination)
dessIndent
Creates the folder by the given pathname, including anynecessary but nonexistent parent folders.
Note that if this operation fails it may have succeeded in creating some of the necessary parent folders.
Will return true if it could make this folder or if the folder did already exist.
prs
Parameters
sIndentdestination ;ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowcreateTempFilename
createTempFile(prefix, suffix)
dessIndent
Creates a temporary file on disk. A prefix and an extension are specified and they will be part of the file name.
prs
Parameters
sIndentprefix ;suffix ;ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowdeleteFilename
deleteFile(destination)
dessIndent
Removes a file from disk. Returns true on success, false otherwise.
prs
Parameters
sIndentdestination ;ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowdeleteFoldername
deleteFolder(destination, showWarning)
dessIndent
Deletes a folder from disk recursively. Returns true on success, false otherwise. If the second parameter is set to true, then a warning will be issued to the user before actually removing the folder.
Returns 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.
Returns 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.
prs
Parameters
sIndenttargetFolderJSFile object.fileFilterFilter or array of filters for files in folder.ret
Returns 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.
prs
Parameters
sIndenttargetFolderJSFile object.fileFilterFilter or array of filters for files in folder.fileOption1=files, 2=dirsret
Returns 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.
prs
Parameters
sIndenttargetFolderJSFile object.fileFilterFilter or array of filters for files in folder.fileOption1=files, 2=dirsvisibleOption1=visible, 2=nonvisibleret
Returns 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.
prs
Parameters
sIndenttargetFolderJSFile object.fileFilterFilter or array of filters for files in folder.fileOption1=files, 2=dirsvisibleOption1=visible, 2=nonvisiblelockedOption1=locked, 2=nonlockedret
Returns 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.
Returns 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.
prs
Parameters
sIndenttargetFolderFile path.fileFilterFilter or array of filters for files in folder.ret
Returns 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.
prs
Parameters
sIndenttargetFolderFile path.fileFilterFilter or array of filters for files in folder.fileOption1=files, 2=dirsret
Returns 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.
prs
Parameters
sIndenttargetFolderFile path.fileFilterFilter or array of filters for files in folder.fileOption1=files, 2=dirsvisibleOption1=visible, 2=nonvisibleret
Returns 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.
prs
Parameters
sIndenttargetFolderFile path.fileFilterFilter or array of filters for files in folder.fileOption1=files, 2=dirsvisibleOption1=visible, 2=nonvisiblelockedOption1=locked, 2=nonlockedret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetHomeFoldername
getHomeFolder()
dessIndent
Returns a JSFile instance corresponding to the home folder of the logged in used.
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.
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.
prs
Parameters
sIndenttargetFolderFolder as JSFile object.fileFilterFilter or array of filters for files in folder.ret
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.
prs
Parameters
sIndenttargetFolderFolder as JSFile object.fileFilterFilter or array of filters for files in folder.fileOption1=files, 2=dirsret
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.
prs
Parameters
sIndenttargetFolderFolder as JSFile object.fileFilterFilter or array of filters for files in folder.fileOption1=files, 2=dirsvisibleOption1=visible, 2=nonvisibleret
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.
prs
Parameters
sIndenttargetFolderFolder as JSFile object.fileFilterFilter or array of filters for files in folder.fileOption1=files, 2=dirsvisibleOption1=visible, 2=nonvisiblelockedOption1=locked, 2=nonlockedret
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.
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.
prs
Parameters
sIndenttargetFolderFolder path.fileFilterFilter or array of filters for files in folder.ret
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.
prs
Parameters
sIndenttargetFolderFolder path.fileFilterFilter or array of filters for files in folder.fileOption1=files, 2=dirsret
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.
prs
Parameters
sIndenttargetFolderFolder path.fileFilterFilter or array of filters for files in folder.fileOption1=files, 2=dirsvisibleOption1=visible, 2=nonvisibleret
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.
prs
Parameters
sIndenttargetFolderFolder path.fileFilterFilter or array of filters for files in folder.fileOption1=files, 2=dirsvisibleOption1=visible, 2=nonvisiblelockedOption1=locked, 2=nonlockedret
Get a url from a remote file that can be used to download the file in a browser.
This is a complete url with the server url that is get from application.getServerURL()
prs
Parameters
sIndentfilethe remote file where the url should be generated from. Must be a remote fileret
Get a url from a remote file that can be used to download the file in a browser.
This is a complete url with the server url that is get from application.getServerURL()
prs
Parameters
sIndentfilethe remote file where the url should be generated from. Must be a remote fileret
Returns
sIndent the url as a stringclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowmoveFilename
moveFile(source, destination)
dessIndent
Moves the file from the source to the destination place. Returns true on success, false otherwise.
prs
Parameters
sIndentsource ;destination ;ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowopenFilename
openFile(file)
dessIndent
Opens the given local file.
Smart Client: launches the default OS associated application to open an existing local file.
Web Client: the (server local) file will open inside the browser - if supported (sent using "Content-disposition: inline" HTTP header).
prs
Parameters
sIndentfilethe local file to open. The file should exist and be accessible.ret
Returns
sIndent success status of the open operationclients
Opens the given local file.
Smart Client: launches the default OS associated application to open an existing local file.
Web Client: the (server local) file will open inside the browser - if supported (sent using "Content-disposition: inline" HTTP header).
prs
Parameters
sIndentfilethe local file to open. The file should exist and be accessible.webClientTargetTarget frame or named dialog/window. For example "_self" to open in the same browser window, "_blank" for another browser window. By default "_blank" is used.webClientTargetOptionswindow options used when a new browser window is to be shown; see browser JS 'window.open(...)' documentation.ret
Returns
sIndent success status of the open operationclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowopenFilename
openFile(fileName, data, mimeType)
dessIndent
Opens the given data as a file.
Smart Client: writes the data to a temporary file, then launches the default OS associated application to open it.
Web Client: the data will open as a file inside the browser - if supported (sent using "Content-disposition: inline" HTTP header).
prs
Parameters
sIndentfileNamethe name of the file that should open with the given data. Can be null (but in Smart Client null - so no extension - will probably make open fail).datathe file's binary content.mimeTypecan be left null, and is used for webclient only. Specify one of any valid mime types: https://developer.mozilla.org/en-US/docs/Properly_Configuring_Server_MIME_Types http://www.iana.org/assignments/media-types/media-types.xhtml http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7ret
Returns
sIndent success status of the open operationclients
Opens the given data as a file.
Smart Client: writes the data to a temporary file, then launches the default OS associated application to open it.
Web Client: the data will open as a file inside the browser - if supported (sent using "Content-disposition: inline" HTTP header).
prs
Parameters
sIndentfileNamethe name of the file that should open with the given data. Can be null (but in Smart Client null - so no extension - will probably make open fail).datathe file's binary content.mimeTypecan be left null, and is used for webclient only. Specify one of any valid mime types: https://developer.mozilla.org/en-US/docs/Properly_Configuring_Server_MIME_Types http://www.iana.org/assignments/media-types/media-types.xhtml http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7webClientTargetTarget frame or named dialog/window. For example "_self" to open in the same browser window, "_blank" for another browser window. By default "_blank" is used.webClientTargetOptionswindow options used when a new browser window is to be shown; see browser JS 'window.open(...)' documentation.ret
Returns
sIndent success status of the open operationclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowreadFilename
readFile()
dessIndent
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)
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowreadFilename
readFile(file)
dessIndent
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)
prs
Parameters
sIndentfileJSFile.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowreadFilename
readFile(file, size)
dessIndent
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)
prs
Parameters
sIndentfileJSFile.sizeNumber of bytes to read.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowreadFilename
readFile(file)
dessIndent
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)
prs
Parameters
sIndentfilethe file path.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowreadFilename
readFile(file, size)
dessIndent
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)
prs
Parameters
sIndentfilethe file path.sizeNumber of bytes to read.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowreadTXTFilename
readTXTFile()
dessIndent
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)
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowreadTXTFilename
readTXTFile(file)
dessIndent
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)
prs
Parameters
sIndentfileJSFile.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowreadTXTFilename
readTXTFile(file, charsetname)
dessIndent
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)
prs
Parameters
sIndentfileJSFile.charsetnameCharset name.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowreadTXTFilename
readTXTFile(file)
dessIndent
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)
prs
Parameters
sIndentfilethe file path.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowreadTXTFilename
readTXTFile(file, charsetname)
dessIndent
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)
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)
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)
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryJSFile instance of default folder; null=default/previousret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryJSFile instance of default folder, null=default/previousmultiselecttrue/falseret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryJSFile instance of default folder,null=default/previousmultiselecttrue/falsefilterA filter or array of filters on the folder files.ret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryJSFile instance of default folder,null=default/previousmultiselecttrue/falsefilterA filter or array of filters on the folder files.callbackfunctionA function that takes the (JSFile) array of the selected files as first argumentret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryJSFile instance of default folder, null=default/previousmultiselecttrue/falsefilterA filter or array of filters on the folder files.callbackfunctionA function that takes the (JSFile) array of the selected files as first argumenttitleThe tile of the dialogret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryJSFile instance of default folder,null=default/previousmultiselecttrue/falsecallbackfunctionA function that takes the (JSFile) array of the selected files as first argumentret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryJSFile instance of default folder,null=default/previouscallbackfunctionA function that takes the (JSFile) array of the selected files as first argumentret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryPath to default folder; null=default/previousret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryPath to default folder, null=default/previousmultiselecttrue/falseret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryPath to default folder,null=default/previousmultiselecttrue/falsefilterA filter or array of filters on the folder files.ret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryPath to default folder,null=default/previousmultiselecttrue/falsefilterA filter or array of filters on the folder files.callbackfunctionA function that takes the (JSFile) array of the selected files as first argumentret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryPath to default folder, null=default/previousmultiselecttrue/falsefilterA filter or array of filters on the folder files.callbackfunctionA function that takes the (JSFile) array of the selected files as first argumenttitleThe tile of the dialogret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryPath to default folder,null=default/previousmultiselecttrue/falsecallbackfunctionA function that takes the (JSFile) array of the selected files as first argumentret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirsstartDirectoryPath to default folder,null=default/previouscallbackfunctionA function that takes the (JSFile) array of the selected files as first argumentret
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)
prs
Parameters
sIndentselectionMode0=both,1=Files,2=DirscallbackfunctionA function that takes the (JSFile) array of the selected files as first argumentret
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)
prs
Parameters
sIndentcallbackfunctionA function that takes the (JSFile) array of the selected files as first argumentret
Shows a file save dialog. File save is only supported in the SmartClient.
prs
Parameters
sIndentfileNameDirFile to save (specified as file path)titleDialog title.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClientsam
Sample
sIdentjavascriptlastDetailRowstreamFilename
streamFile(file)
dessIndent
Stream the given file(path) to the browser with content-disposition:attachment
This will not load in the file fully into memory but only stream it right from disk.
This can be any filepath on the server, but only the simple file name is exposed as the content disposition header filename.
This will throw an exception if anything goes wrong, like the given file is not valid/found.
prs
Parameters
sIndentfileA path string, JSFile or RemoteFileclients
Supported Clients
sIndentNGClientsam
Sample
sIdentjavascriptlastDetailRowstreamFilename
streamFile(file, contentDisposition)
dessIndent
String the given file(path) to the browser you can provide the content disposition how this should be send (inline or as an attachment)
This will not load in the file fully into memory but only stream it right from disk.
This can be any filepath on the server, but only the simple file name is exposed.
This will throw an exception if anything goes wrong, like the given file is not valid/found.
prs
Parameters
sIndentfileA path string, JSFile or RemoteFilecontentDispositioncan be 'inline' or 'attachment'clients
String the given file(path) to the browser you can provide the content disposition how this should be send (inline or as an attachment)
This will not load in the file fully into memory but only stream it right from disk.
This can be any filepath on the server, but only the simple file name is exposed.
This will throw an exception if anything goes wrong, like the given file is not valid/found.
Give the browser target if you want to open the file inside another tab, most usefull in 'inline' content disposition mode.
prs
Parameters
sIndentfileA path string, JSFile or RemoteFilecontentDispositioncan be 'inline' or 'attachment'browserTarget_blank or a specific name to open this in a differnt tab (really only usefull in inline mode)clients
Stream 1 or more files from the server to the client.
prs
Parameters
sIndentfilesfile(s) to be streamed into (can be a String path a JSFile) or an Array of theseserverFilesthe files on the server that will be transfered to the client, can be a String or a String[]ret
Returns
sIndent a JSProgressMonitor object to allow client to subscribe to progress notificationsclients
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.
prs
Parameters
sIndentfilesfile(s) to be streamed into (can be a String path or a JSFile) or an Array of theseserverFilesthe files on the server that will be transfered to the client, can be a JSFile or JSFile[], a String or String[]callbackthe Function to be called back at the end of the process (for every file); the callback function is invoked with argument the filename that was transfered; an extra second exception parameter can be given if an exception occuredret
Returns
sIndent a JSProgressMonitor object to allow client to subscribe to progress notificationsclients
Overloaded method, defines file(s) to be streamed and a callback function
prs
Parameters
sIndentfilesfile(s) to be streamed (can be a String path or a JSFile) or an Array of theseserverFilescan be a JSFile or JSFile[], a String or String[], representing the file name(s) to use on the serverret
Returns
sIndent a JSProgressMonitor object to allow client to subscribe to progress notificationsclients
Overloaded method, defines file(s) to be streamed, a callback function and file name(s) to use on the server
prs
Parameters
sIndentfilesfile(s) to be streamed (can be a String path or a JSFile) or an Array of these)serverFilescan be a JSFile or JSFile[], a String or String[], representing the file name(s) to use on the servercallbackthe Function to be called back at the end of the process (for every file); the callback function is invoked with argument the filename that was transfered; an extra second exception parameter can be given if an exception occuredret
Returns
sIndent a JSProgressMonitor object to allow client to subscribe to progress notificationsclients
Overloaded method, defines file(s) to be streamed and a callback function
prs
Parameters
sIndentfilesfile(s) to be streamed (can be a String path or a JSFile) or an Array of thesecallbackthe Function to be called back at the end of the process (for every file); the callback function is invoked with argument the filename that was transfered; an extra second exception parameter can be given if an exception occuredret
Returns
sIndent a JSProgressMonitor object to allow client to subscribe to progress notificationsclients
If the client's solution is closed, the file given to this method wil be deleted.
This can be a remote or local file.
This can be used to have temp files within a client that will be cleaned up when the solution is closed.
So they live as long as the client has its solution open.
prs
Parameters
sIndentfilethe file to trackclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowwriteFilename
writeFile(file, data)
dessIndent
Writes the given file to disk.
If "file" is a JSFile or you are running in Smart Client, it writes data into a (local) binary file.
If you are running in Web Client and "file" is a String (like 'mypdffile.pdf' to hint the browser what it is) the user will get
prompted by the browser to save the file (sent using "Content-disposition: attachment" HTTP header). If it is a JSFile instance
in this case it will be saved as a file on the server.
prs
Parameters
sIndentfilea local JSFiledatathe data to be writtenret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowwriteFilename
writeFile(file, data, mimeType)
dessIndent
Writes the given file to disk.
If "file" is a JSFile or you are running in Smart Client, it writes data into a (local) binary file.
If you are running in Web Client and "file" is a String (like 'mypdffile.pdf' to hint the browser what it is) the user will get
prompted by the browser to save the file (sent using "Content-disposition: attachment" HTTP header). If it is a JSFile instance
in this case it will be saved as a file on the server.
prs
Parameters
sIndentfilea local JSFiledatathe data to be writtenmimeTypethe mime type (used in Web-Client)ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowwriteFilename
writeFile(file, data)
dessIndent
Writes the given file to disk.
If "file" is a JSFile or you are running in Smart Client, it writes data into a (local) binary file.
If you are running in Web Client and "file" is a String (like 'mypdffile.pdf' to hint the browser what it is) the user will get
prompted by the browser to save the file (sent using "Content-disposition: attachment" HTTP header). If it is a JSFile instance
in this case it will be saved as a file on the server.
prs
Parameters
sIndentfilethe file path as a Stringdatathe data to be writtenret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowwriteFilename
writeFile(file, data, mimeType)
dessIndent
Writes the given file to disk.
If "file" is a JSFile or you are running in Smart Client, it writes data into a (local) binary file.
If you are running in Web Client and "file" is a String (like 'mypdffile.pdf' to hint the browser what it is) the user will get
prompted by the browser to save the file (sent using "Content-disposition: attachment" HTTP header). If it is a JSFile instance
in this case it will be saved as a file on the server.
prs
Parameters
sIndentfilethe file path as a Stringdatathe data to be writtenmimeTypethe mime type (used in Web-Client)ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowwriteTXTFilename
writeTXTFile(file, text_data)
dessIndent
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)
prs
Parameters
sIndentfileJSFiletext_dataText to be written.ret
Returns
sIndent Success boolean.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowwriteTXTFilename
writeTXTFile(file, text_data, charsetname)
dessIndent
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)
prs
Parameters
sIndentfileJSFiletext_dataText to be written.charsetnameCharset name.ret
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)
prs
Parameters
sIndentfileJSFiletext_dataText to be written.charsetnameCharset name.mimeTypeContent type (used only on web).ret
Returns
sIndent Success boolean.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowwriteTXTFilename
writeTXTFile(file, text_data)
dessIndent
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)
prs
Parameters
sIndentfileThe file path.text_dataText to be written.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowwriteTXTFilename
writeTXTFile(file, text_data, charsetname)
dessIndent
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)
prs
Parameters
sIndentfileThe file path.text_dataText to be written.charsetnameCharset name.ret
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)
prs
Parameters
sIndentfileThe file path.text_dataText to be written.charsetnameCharset name.mimeTypeContent type (used only on web).ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowwriteXMLFilename
writeXMLFile(file, xml_data)
dessIndent
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)
prs
Parameters
sIndentfilea local JSFilexml_datathe xml data to writeret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowwriteXMLFilename
writeXMLFile(file, xml_data, encoding)
dessIndent
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)
prs
Parameters
sIndentfilea local JSFilexml_datathe xml data to writeencodingthe specified encodingret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowwriteXMLFilename
writeXMLFile(file, xml_data)
dessIndent
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)
prs
Parameters
sIndentfilethe file path as a Stringxml_datathe xml data to writeret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowwriteXMLFilename
writeXMLFile(file, xml_data, encoding)
dessIndent
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)
prs
Parameters
sIndentfilethe file path as a Stringxml_datathe xml data to writeencodingthe specified encodingret