DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR
Return Types
{column:width=80px|padding=0px}{column}{column}{column}
Server Property Summary
{column:width=80px|padding=0px}{column}{column}{column}
Method Summary
appendToTXTFile(file, text)
Appends a string given in parameter to a file, using default platform encoding.
appendToTXTFile(file, text, encoding)
Appends a string given in parameter to a file, using the specified encoding.
appendToTXTFile(file, text)
Appends a string given in parameter to a file, using default platform encoding.
convertToJSFile(file)
Returns a JSFile instance corresponding to an alternative representation of a file (for example a string).
convertToRemoteJSFile(path)
Convenience return to get a JSFile representation of a server file based on its path.
copyFolder(source, destination)
Copies the sourcefolder to the destination folder, recursively.
createFile(targetFile)
Creates a JSFile instance.
createFolder(destination)
Creates a folder on disk.
createTempFile(prefix, suffix)
Creates a temporary file on disk.
deleteFile(destination)
Removes a file from disk.
deleteFolder(destination, showWarning)
Deletes a folder from disk recursively.
getDefaultUploadLocation()
Returns the default upload location path of the server.
getDesktopFolder()
Returns a JSFile instance that corresponds to the Desktop folder of the currently logged in user.
JSFile[]
getDiskList()
Returns an Array of JSFile instances correponding to the file system root folders.
getFileSize(path)
Returns the size of the specified file.
JSFile[]
getFolderContents(targetFolder)
Returns an array of JSFile instances corresponding to content of the specified folder.
JSFile[]
getFolderContents(targetFolder, fileFilter)
Returns an array of JSFile instances corresponding to content of the specified folder.
JSFile[]
getFolderContents(targetFolder, fileFilter, fileOption)
Returns an array of JSFile instances corresponding to content of the specified folder.
JSFile[]
getFolderContents(targetFolder, fileFilter, fileOption, visibleOption)
Returns an array of JSFile instances corresponding to content of the specified folder.
JSFile[]
getFolderContents(targetFolder, fileFilter, fileOption, visibleOption, lockedOption)
Returns an array of JSFile instances corresponding to content of the specified folder.
JSFile[]
getFolderContents(targetFolder)
Returns an array of JSFile instances corresponding to content of the specified folder.
JSFile[]
getFolderContents(targetFolder, fileFilter)
Returns an array of JSFile instances corresponding to content of the specified folder.
JSFile[]
getFolderContents(targetFolder, fileFilter, fileOption)
Returns an array of JSFile instances corresponding to content of the specified folder.
JSFile[]
getFolderContents(targetFolder, fileFilter, fileOption, visibleOption)
Returns an array of JSFile instances corresponding to content of the specified folder.
JSFile[]
getFolderContents(targetFolder, fileFilter, fileOption, visibleOption, lockedOption)
Returns an array of JSFile instances corresponding to content of the specified folder.
getHomeFolder()
Returns a JSFile instance corresponding to the home folder of the logged in used.
getModificationDate(path)
Returns the modification date of a file.
JSFile[]
getRemoteFolderContents(targetFolder)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.
JSFile[]
getRemoteFolderContents(targetFolder, fileFilter)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.
JSFile[]
getRemoteFolderContents(targetFolder, fileFilter, fileOption)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.
JSFile[]
getRemoteFolderContents(targetFolder, fileFilter, fileOption, visibleOption)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.
JSFile[]
getRemoteFolderContents(targetFolder, fileFilter, fileOption, visibleOption, lockedOption)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.
JSFile[]
getRemoteFolderContents(targetFolder)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.
JSFile[]
getRemoteFolderContents(targetFolder, fileFilter)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.
JSFile[]
getRemoteFolderContents(targetFolder, fileFilter, fileOption)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.
JSFile[]
getRemoteFolderContents(targetFolder, fileFilter, fileOption, visibleOption)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.
JSFile[]
getRemoteFolderContents(targetFolder, fileFilter, fileOption, visibleOption, lockedOption)
Returns an array of JSFile instances corresponding to content of the specified folder on the server side.
byte[]
readFile()
Reads all or part of the content from a binary file.
byte[]
readFile(file)
Reads all or part of the content from a binary file.
byte[]
readFile(file, size)
Reads all or part of the content from a binary file.
byte[]
readFile(file)
Reads all or part of the content from a binary file.
byte[]
readFile(file, size)
Reads all or part of the content from a binary file.
readTXTFile()
Read all content from a text file.
readTXTFile(file)
Read all content from a text file.
readTXTFile(file, charsetname)
Read all content from a text file.
readTXTFile(file)
Read all content from a text file.
readTXTFile(file, charsetname)
Read all content from a text file.
showDirectorySelectDialog()
Shows a directory selector dialog.
showDirectorySelectDialog(directory)
Shows a directory selector dialog.
showDirectorySelectDialog(directory, title)
Shows a directory selector dialog.
showDirectorySelectDialog(directory)
Shows a directory selector dialog.
showDirectorySelectDialog(directory, title)
Shows a directory selector dialog.
showFileOpenDialog()
Shows a file open dialog.
showFileOpenDialog(selectionMode)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory, multiselect)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory, multiselect, filter)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory, multiselect, filter, callbackfunction)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory, multiselect, filter, callbackfunction, title)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory, multiselect, callbackfunction)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory, callbackfunction)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory, multiselect)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory, multiselect, filter)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory, multiselect, filter, callbackfunction)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory, multiselect, filter, callbackfunction, title)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory, multiselect, callbackfunction)
Shows a file open dialog.
showFileOpenDialog(selectionMode, startDirectory, callbackfunction)
Shows a file open dialog.
showFileOpenDialog(selectionMode, callbackfunction)
Shows a file open dialog.
showFileOpenDialog(callbackfunction)
Shows a file open dialog.
showFileSaveDialog()
Shows a file save dialog.
showFileSaveDialog(fileNameDir)
Shows a file save dialog.
showFileSaveDialog(fileNameDir, title)
Shows a file save dialog.
showFileSaveDialog(fileNameDir)
Shows a file save dialog.
showFileSaveDialog(fileNameDir, title)
Shows a file save dialog.
streamFilesFromServer(files, serverFiles)
Stream 1 or more files from the server to the client.
streamFilesFromServer(files, serverFiles, callback)
Stream 1 or more files from the server to the client, the callback method is invoked after every file, with as argument
the filename that was transfered.
streamFilesToServer(files)
Overloaded method, only defines file(s) to be streamed
streamFilesToServer(files, serverFiles)
Overloaded method, defines file(s) to be streamed and a callback function
streamFilesToServer(files, serverFiles, callback)
Overloaded method, defines file(s) to be streamed, a callback function and file name(s) to use on the server
streamFilesToServer(files, callback)
Overloaded method, defines file(s) to be streamed and a callback function
writeTXTFile(file, text_data)
Writes data into a text file.
writeTXTFile(file, text_data, charsetname)
Writes data into a text file.
writeTXTFile(file, text_data, charsetname, mimeType)
Writes data into a text file.
writeTXTFile(file, text_data)
Writes data into a text file.
writeTXTFile(file, text_data, charsetname)
Writes data into a text file.
writeTXTFile(file, text_data, charsetname, mimeType)
Writes data into a text file.
writeXMLFile(file, xml_data)
Writes data into an XML file.
writeXMLFile(file, xml_data, encoding)
Writes data into an XML file.
writeXMLFile(file, xml_data)
Writes data into an XML file.
writeXMLFile(file, xml_data, encoding)
Writes data into an XML file.
{column:width=100%|padding=0px}{column}
Server Property Details
{column:width=100%|padding=0px}{column}
Method Details
appendToTXTFile
(file, text)
Since
Servoy 5.2
Sample
// append some text to a text file: var ok = plugins.file.appendToTXTFile('myTextFile.txt', '\nMy fantastic new line of text\n');
appendToTXTFile
(file, text, encoding)
Since
Servoy 5.2
Sample
// append some text to a text file: var ok = plugins.file.appendToTXTFile('myTextFile.txt', '\nMy fantastic new line of text\n');
appendToTXTFile
(file, text)
Since
Servoy 5.2
Sample
// append some text to a text file: var ok = plugins.file.appendToTXTFile('myTextFile.txt', '\nMy fantastic new line of text\n');
appendToTXTFile
(file, text, encoding)
Sample
// append some text to a text file: var ok = plugins.file.appendToTXTFile('myTextFile.txt', '\nMy fantastic new line of text\n');
convertToJSFile
(file)
Sample
var f = plugins.file.convertToJSFile("story.txt"); if (f.canRead()) application.output("File can be read.");
convertToRemoteJSFile
(path)
Since
Servoy 5.2
Parameters
{String} path – the path representing a file on the server (should start with "/")
Sample
var f = plugins.file.convertToRemoteJSFile('/story.txt'); if (f && f.canRead()) application.output('File can be read.');
copyFile
(source, destination)
Sample
// 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.");
copyFolder
(source, destination)
Sample
// 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.");
createFile
(targetFile)
Sample
// 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.");
createFolder
(destination)
Sample
var d = plugins.file.convertToJSFile("newfolder"); if (!plugins.file.createFolder(d)) application.output("Folder could not be created.");
createTempFile
(prefix, suffix)
Sample
var tempFile = plugins.file.createTempFile('myfile','.txt'); application.output('Temporary file created as: ' + tempFile.getAbsolutePath()); plugins.file.writeTXTFile(tempFile, 'abcdefg');
deleteFile
(destination)
Sample
if (plugins.file.deleteFile('story.txt')) application.output('File deleted.');
deleteFolder
(destination, showWarning)
Sample
if (plugins.file.deleteFolder('stories', true)) application.output('Folder deleted.');
getDefaultUploadLocation
()
Sample
// get the (server-side) default upload location path: var serverPath = plugins.file.getDefaultUploadLocation();
getDesktopFolder
()
Sample
var d = plugins.file.getDesktopFolder(); application.output('desktop folder is: ' + d.getAbsolutePath());
JSFile[]
getDiskList
()
Sample
var roots = plugins.file.getDiskList(); for (var i = 0; i < roots.length; i++) application.output(roots[i].getAbsolutePath());
getFileSize
(path)
Sample
var f = plugins.file.convertToJSFile('story.txt'); application.output('file size: ' + plugins.file.getFileSize(f));
JSFile[]
getFolderContents
(targetFolder)
Sample
var files = plugins.file.getFolderContents('stories', '.txt'); for (var i=0; i<files.length; i++) application.output(files[i].getAbsolutePath());
JSFile[]
getFolderContents
(targetFolder, fileFilter)
Sample
var files = plugins.file.getFolderContents('stories', '.txt'); for (var i=0; i<files.length; i++) application.output(files[i].getAbsolutePath());
JSFile[]
getFolderContents
(targetFolder, fileFilter, fileOption)
Sample
var files = plugins.file.getFolderContents('stories', '.txt'); for (var i=0; i<files.length; i++) application.output(files[i].getAbsolutePath());
JSFile[]
getFolderContents
(targetFolder, fileFilter, fileOption, visibleOption)
Sample
var files = plugins.file.getFolderContents('stories', '.txt'); for (var i=0; i<files.length; i++) application.output(files[i].getAbsolutePath());
JSFile[]
getFolderContents
(targetFolder, fileFilter, fileOption, visibleOption, lockedOption)
Sample
var files = plugins.file.getFolderContents('stories', '.txt'); for (var i=0; i<files.length; i++) application.output(files[i].getAbsolutePath());
JSFile[]
getFolderContents
(targetFolder)
Sample
var files = plugins.file.getFolderContents('stories', '.txt'); for (var i=0; i<files.length; i++) application.output(files[i].getAbsolutePath());
JSFile[]
getFolderContents
(targetFolder, fileFilter)
Sample
var files = plugins.file.getFolderContents('stories', '.txt'); for (var i=0; i<files.length; i++) application.output(files[i].getAbsolutePath());
JSFile[]
getFolderContents
(targetFolder, fileFilter, fileOption)
Sample
var files = plugins.file.getFolderContents('stories', '.txt'); for (var i=0; i<files.length; i++) application.output(files[i].getAbsolutePath());
JSFile[]
getFolderContents
(targetFolder, fileFilter, fileOption, visibleOption)
Sample
var files = plugins.file.getFolderContents('stories', '.txt'); for (var i=0; i<files.length; i++) application.output(files[i].getAbsolutePath());
JSFile[]
getFolderContents
(targetFolder, fileFilter, fileOption, visibleOption, lockedOption)
Sample
var files = plugins.file.getFolderContents('stories', '.txt'); for (var i=0; i<files.length; i++) application.output(files[i].getAbsolutePath());
getHomeFolder
()
Sample
var d = plugins.file.getHomeFolder(); application.output('home folder: ' + d.getAbsolutePath());
getModificationDate
(path)
Sample
var f = plugins.file.convertToJSFile('story.txt'); application.output('last changed: ' + plugins.file.getModificationDate(f));
JSFile[]
getRemoteFolderContents
(targetFolder)
Since
Servoy 5.2.1
Sample
// retrieves an array of files located on the server side inside the default upload folder: var files = plugins.file.getRemoteFolderContents('/', '.txt');
JSFile[]
getRemoteFolderContents
(targetFolder, fileFilter)
Sample
// retrieves an array of files located on the server side inside the default upload folder: var files = plugins.file.getRemoteFolderContents('/', '.txt');
JSFile[]
getRemoteFolderContents
(targetFolder, fileFilter, fileOption)
Sample
// retrieves an array of files located on the server side inside the default upload folder: var files = plugins.file.getRemoteFolderContents('/', '.txt');
JSFile[]
getRemoteFolderContents
(targetFolder, fileFilter, fileOption, visibleOption)
Sample
// retrieves an array of files located on the server side inside the default upload folder: var files = plugins.file.getRemoteFolderContents('/', '.txt');
JSFile[]
getRemoteFolderContents
(targetFolder, fileFilter, fileOption, visibleOption, lockedOption)
Parameters
Sample
// retrieves an array of files located on the server side inside the default upload folder: var files = plugins.file.getRemoteFolderContents('/', '.txt');
JSFile[]
getRemoteFolderContents
(targetFolder)
Sample
// retrieves an array of files located on the server side inside the default upload folder: var files = plugins.file.getRemoteFolderContents('/', '.txt');
JSFile[]
getRemoteFolderContents
(targetFolder, fileFilter)
Sample
// retrieves an array of files located on the server side inside the default upload folder: var files = plugins.file.getRemoteFolderContents('/', '.txt');
JSFile[]
getRemoteFolderContents
(targetFolder, fileFilter, fileOption)
Sample
// retrieves an array of files located on the server side inside the default upload folder: var files = plugins.file.getRemoteFolderContents('/', '.txt');
JSFile[]
getRemoteFolderContents
(targetFolder, fileFilter, fileOption, visibleOption)
Sample
// retrieves an array of files located on the server side inside the default upload folder: var files = plugins.file.getRemoteFolderContents('/', '.txt');
JSFile[]
getRemoteFolderContents
(targetFolder, fileFilter, fileOption, visibleOption, lockedOption)
Sample
// retrieves an array of files located on the server side inside the default upload folder: var files = plugins.file.getRemoteFolderContents('/', '.txt');
moveFile
(source, destination)
Sample
// 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.');
byte[]
readFile
()
Returns
byte[]
Sample
// 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);
byte[]
readFile
(file)
Returns
byte[]
Sample
// 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);
byte[]
readFile
(file, size)
Returns
byte[]
Sample
// 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);
byte[]
readFile
(file)
Returns
byte[]
Sample
// 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);
byte[]
readFile
(file, size)
Returns
byte[]
Sample
// 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);
readTXTFile
()
Sample
// 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);
readTXTFile
(file)
Sample
// 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);
readTXTFile
(file, charsetname)
Sample
// 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);
readTXTFile
(file)
Sample
// 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);
readTXTFile
(file, charsetname)
Sample
// 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);
showDirectorySelectDialog
()
Sample
var dir = plugins.file.showDirectorySelectDialog(); application.output("you've selected folder: " + dir.getAbsolutePath());
showDirectorySelectDialog
(directory)
Parameters
{JSFile} directory – Default directory as JSFile.
Sample
var dir = plugins.file.showDirectorySelectDialog(); application.output("you've selected folder: " + dir.getAbsolutePath());
showDirectorySelectDialog
(directory, title)
Sample
var dir = plugins.file.showDirectorySelectDialog(); application.output("you've selected folder: " + dir.getAbsolutePath());
showDirectorySelectDialog
(directory)
Parameters
{String} directory – Default directory as file path.
Sample
var dir = plugins.file.showDirectorySelectDialog(); application.output("you've selected folder: " + dir.getAbsolutePath());
showDirectorySelectDialog
(directory, title)
Sample
var dir = plugins.file.showDirectorySelectDialog(); application.output("you've selected folder: " + dir.getAbsolutePath());
showFileOpenDialog
()
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode)
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory)
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory, multiselect)
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory, multiselect, filter)
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory, multiselect, filter, callbackfunction)
Parameters
{Number} selectionMode – 0=both,1=Files,2=Dirs
{JSFile} startDirectory – JSFile instance of default folder,null=default/previous
{Boolean} multiselect – true/false
{Object} filter – A filter or array of filters on the folder files.
{Function} callbackfunction – A function that takes the (JSFile) array of the selected files as first argument
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory, multiselect, filter, callbackfunction, title)
Parameters
{Number} selectionMode – 0=both,1=Files,2=Dirs
{JSFile} startDirectory – JSFile instance of default folder, null=default/previous
{Boolean} multiselect – true/false
{Object} filter – A filter or array of filters on the folder files.
{Function} callbackfunction – A function that takes the (JSFile) array of the selected files as first argument
{String} title – The tile of the dialog
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory, multiselect, callbackfunction)
Parameters
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory, callbackfunction)
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory)
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory, multiselect)
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory, multiselect, filter)
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory, multiselect, filter, callbackfunction)
Parameters
{Number} selectionMode – 0=both,1=Files,2=Dirs
{String} startDirectory – Path to default folder,null=default/previous
{Boolean} multiselect – true/false
{Object} filter – A filter or array of filters on the folder files.
{Function} callbackfunction – A function that takes the (JSFile) array of the selected files as first argument
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory, multiselect, filter, callbackfunction, title)
Parameters
{Number} selectionMode – 0=both,1=Files,2=Dirs
{String} startDirectory – Path to default folder, null=default/previous
{Boolean} multiselect – true/false
{Object} filter – A filter or array of filters on the folder files.
{Function} callbackfunction – A function that takes the (JSFile) array of the selected files as first argument
{String} title – The tile of the dialog
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory, multiselect, callbackfunction)
Parameters
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, startDirectory, callbackfunction)
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(selectionMode, callbackfunction)
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileOpenDialog
(callbackfunction)
Parameters
{Function} callbackfunction – A function that takes the (JSFile) array of the selected files as first argument
Sample
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and // the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")'). /** @type {JSFile} */ var f = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF", "jpg", "gif")); application.output('File: ' + f.getName()); application.output('is dir: ' + f.isDirectory()); application.output('is file: ' + f.isFile()); application.output('path: ' + f.getAbsolutePath()); // This allows mutliple selection of files, using previous dir and the same filter as above. This also casts the result to the JSFile type using JSDoc. // if filters are specified, "all file" filter will not show up unless "*" filter is present /** @type {JSFile[]} */ var files = plugins.file.showFileOpenDialog(1, null, true, new Array("JPG and GIF", "jpg", "gif", "*")); for (var i = 0; i < files.length; i++) { application.output('File: ' + files[i].getName()); application.output('content type: ' + files[i].getContentType()); application.output('last modified: ' + files[i].lastModified()); application.output('size: ' + files[i].size()); } //for the web you have to give a callback function that has a JSFile array as its first argument (also works in smart), only multi select and the title are used in the webclient, others are ignored plugins.file.showFileOpenDialog(null,null,false,mycallbackfunction,'Select some nice files')
showFileSaveDialog
()
Sample
var file = plugins.file.showFileSaveDialog(); application.output("you've selected file: " + file.getAbsolutePath());
showFileSaveDialog
(fileNameDir)
Sample
var file = plugins.file.showFileSaveDialog(); application.output("you've selected file: " + file.getAbsolutePath());
showFileSaveDialog
(fileNameDir, title)
Sample
var file = plugins.file.showFileSaveDialog(); application.output("you've selected file: " + file.getAbsolutePath());
showFileSaveDialog
(fileNameDir)
Parameters
{String} fileNameDir – File (give as file path) to save.
Sample
var file = plugins.file.showFileSaveDialog(); application.output("you've selected file: " + file.getAbsolutePath());
showFileSaveDialog
(fileNameDir, title)
Sample
var file = plugins.file.showFileSaveDialog(); application.output("you've selected file: " + file.getAbsolutePath());
streamFilesFromServer
(files, serverFiles)
Since
Servoy 5.2
Returns
JSProgressMonitor – a JSProgressMonitor object to allow client to subscribe to progress notifications
Sample
// transfer all the files of a chosen server folder to a directory on the client var dir = plugins.file.showDirectorySelectDialog(); if (dir) { var list = plugins.file.getRemoteFolderContents('/images/user1/', null, 1); if (list) { var monitor = plugins.file.streamFilesFromServer(dir, list, callbackFunction); } } // transfer one file on the client var monitor = plugins.file.streamFilesFromServer('/path/to/file', 'path/to/serverFile', callbackFunction); // transfer an array of serverFiles to an array of files on the client var files = new Array(); files[0] = '/path/to/file1'; files[1] = '/path/to/file2'; var serverFiles = new Array(); serverFiles[0] = '/path/to/serverFile1'; serverFiles[1] = '/path/to/serverFile2'; var monitor = plugins.file.streamFilesFromServer(files, serverFiles, callbackFunction);
streamFilesFromServer
(files, serverFiles, callback)
Since
Servoy 5.2
Parameters
{Object} files – file(s) to be streamed into (can be a String path or a JSFile) or an Array of these
{Object} serverFiles – the files on the server that will be transfered to the client, can be a JSFile or JSFile[], a String or String[]
{Function} callback – the Function to be called back at the end of the process (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 occured
Returns
JSProgressMonitor – a JSProgressMonitor object to allow client to subscribe to progress notifications
Sample
// transfer all the files of a chosen server folder to a directory on the client var dir = plugins.file.showDirectorySelectDialog(); if (dir) { var list = plugins.file.getRemoteFolderContents('/images/user1/', null, 1); if (list) { var monitor = plugins.file.streamFilesFromServer(dir, list, callbackFunction); } } // transfer one file on the client var monitor = plugins.file.streamFilesFromServer('/path/to/file', 'path/to/serverFile', callbackFunction); // transfer an array of serverFiles to an array of files on the client var files = new Array(); files[0] = '/path/to/file1'; files[1] = '/path/to/file2'; var serverFiles = new Array(); serverFiles[0] = '/path/to/serverFile1'; serverFiles[1] = '/path/to/serverFile2'; var monitor = plugins.file.streamFilesFromServer(files, serverFiles, callbackFunction);
streamFilesToServer
(files)
Since
Servoy 5.2
Parameters
{Object} files – file(s) to be streamed (can be a String path or a JSFile) or an Array of these
Returns
JSProgressMonitor – a JSProgressMonitor object to allow client to subscribe to progress notifications
Sample
// send one file: var file = plugins.file.showFileOpenDialog( 1, null, false, null, null, 'Choose a file to transfer' ); if (file) { plugins.file.streamFilesToServer( file, callbackFunction ); } //plugins.file.streamFilesToServer( 'servoy.txt', callbackFunction ); // send an array of files: var folder = plugins.file.showDirectorySelectDialog(); if (folder) { var files = plugins.file.getFolderContents(folder); if (files) { var monitor = plugins.file.streamFilesToServer( files, callbackFunction ); } } // var files = new Array() // files[0] = 'file1.txt'; // files[1] = 'file2.txt'; // var monitor = plugins.file.streamFilesToServer( files, callbackFunction );
streamFilesToServer
(files, serverFiles)
Since
Servoy 5.2
Returns
JSProgressMonitor – a JSProgressMonitor object to allow client to subscribe to progress notifications
Sample
// send one file: var file = plugins.file.showFileOpenDialog( 1, null, false, null, null, 'Choose a file to transfer' ); if (file) { plugins.file.streamFilesToServer( file, callbackFunction ); } //plugins.file.streamFilesToServer( 'servoy.txt', callbackFunction ); // send an array of files: var folder = plugins.file.showDirectorySelectDialog(); if (folder) { var files = plugins.file.getFolderContents(folder); if (files) { var monitor = plugins.file.streamFilesToServer( files, callbackFunction ); } } // var files = new Array() // files[0] = 'file1.txt'; // files[1] = 'file2.txt'; // var monitor = plugins.file.streamFilesToServer( files, callbackFunction );
streamFilesToServer
(files, serverFiles, callback)
Since
Servoy 5.2
Parameters
{Object} files – file(s) to be streamed (can be a String path or a JSFile) or an Array of these)
{Object} serverFiles – can be a JSFile or JSFile[], a String or String[], representing the file name(s) to use on the server
{Function} callback – the 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 occured
Returns
JSProgressMonitor – a JSProgressMonitor object to allow client to subscribe to progress notifications
Sample
// send one file: var file = plugins.file.showFileOpenDialog( 1, null, false, null, null, 'Choose a file to transfer' ); if (file) { plugins.file.streamFilesToServer( file, callbackFunction ); } //plugins.file.streamFilesToServer( 'servoy.txt', callbackFunction ); // send an array of files: var folder = plugins.file.showDirectorySelectDialog(); if (folder) { var files = plugins.file.getFolderContents(folder); if (files) { var monitor = plugins.file.streamFilesToServer( files, callbackFunction ); } } // var files = new Array() // files[0] = 'file1.txt'; // files[1] = 'file2.txt'; // var monitor = plugins.file.streamFilesToServer( files, callbackFunction );
streamFilesToServer
(files, callback)
Since
Servoy 5.2
Parameters
{Object} files – file(s) to be streamed (can be a String path or a JSFile) or an Array of these
{Function} callback – the 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 occured
Returns
JSProgressMonitor – a JSProgressMonitor object to allow client to subscribe to progress notifications
Sample
// send one file: var file = plugins.file.showFileOpenDialog( 1, null, false, null, null, 'Choose a file to transfer' ); if (file) { plugins.file.streamFilesToServer( file, callbackFunction ); } //plugins.file.streamFilesToServer( 'servoy.txt', callbackFunction ); // send an array of files: var folder = plugins.file.showDirectorySelectDialog(); if (folder) { var files = plugins.file.getFolderContents(folder); if (files) { var monitor = plugins.file.streamFilesToServer( files, callbackFunction ); } } // var files = new Array() // files[0] = 'file1.txt'; // files[1] = 'file2.txt'; // var monitor = plugins.file.streamFilesToServer( files, callbackFunction );
writeFile
(file, data)
Parameters
{JSFile} file – a local JSFile
{byte[]} data – the data to be written
Sample
/**@type {Array<byte>}*/ var bytes = new Array(); for (var i=0; i<1024; i++) bytes[i] = i % 100; var f = plugins.file.convertToJSFile('bin.dat'); if (!plugins.file.writeFile(f, bytes)) application.output('Failed to write the file.'); // mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp' var mimeType = 'application/vnd.ms-excel' if (!plugins.file.writeFile(f, bytes, mimeType)) application.output('Failed to write the file.');
writeFile
(file, data, mimeType)
Sample
/**@type {Array<byte>}*/ var bytes = new Array(); for (var i=0; i<1024; i++) bytes[i] = i % 100; var f = plugins.file.convertToJSFile('bin.dat'); if (!plugins.file.writeFile(f, bytes)) application.output('Failed to write the file.'); // mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp' var mimeType = 'application/vnd.ms-excel' if (!plugins.file.writeFile(f, bytes, mimeType)) application.output('Failed to write the file.');
writeFile
(file, data)
Parameters
{String} file – the file path as a String
{byte[]} data – the data to be written
Sample
/**@type {Array<byte>}*/ var bytes = new Array(); for (var i=0; i<1024; i++) bytes[i] = i % 100; var f = plugins.file.convertToJSFile('bin.dat'); if (!plugins.file.writeFile(f, bytes)) application.output('Failed to write the file.'); // mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp' var mimeType = 'application/vnd.ms-excel' if (!plugins.file.writeFile(f, bytes, mimeType)) application.output('Failed to write the file.');
writeFile
(file, data, mimeType)
Sample
/**@type {Array<byte>}*/ var bytes = new Array(); for (var i=0; i<1024; i++) bytes[i] = i % 100; var f = plugins.file.convertToJSFile('bin.dat'); if (!plugins.file.writeFile(f, bytes)) application.output('Failed to write the file.'); // mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp' var mimeType = 'application/vnd.ms-excel' if (!plugins.file.writeFile(f, bytes, mimeType)) application.output('Failed to write the file.');
writeTXTFile
(file, text_data)
Sample
var fileNameSuggestion = 'myspecialexport.tab' var textData = 'load of data...' var success = plugins.file.writeTXTFile(fileNameSuggestion, textData); if (!success) application.output('Could not write file.'); // For file-encoding parameter options (default OS encoding is used), http://download.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html // mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp'
writeTXTFile
(file, text_data, charsetname)
Sample
var fileNameSuggestion = 'myspecialexport.tab' var textData = 'load of data...' var success = plugins.file.writeTXTFile(fileNameSuggestion, textData); if (!success) application.output('Could not write file.'); // For file-encoding parameter options (default OS encoding is used), http://download.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html // mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp'
writeTXTFile
(file, text_data, charsetname, mimeType)
Sample
var fileNameSuggestion = 'myspecialexport.tab' var textData = 'load of data...' var success = plugins.file.writeTXTFile(fileNameSuggestion, textData); if (!success) application.output('Could not write file.'); // For file-encoding parameter options (default OS encoding is used), http://download.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html // mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp'
writeTXTFile
(file, text_data)
Sample
var fileNameSuggestion = 'myspecialexport.tab' var textData = 'load of data...' var success = plugins.file.writeTXTFile(fileNameSuggestion, textData); if (!success) application.output('Could not write file.'); // For file-encoding parameter options (default OS encoding is used), http://download.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html // mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp'
writeTXTFile
(file, text_data, charsetname)
Sample
var fileNameSuggestion = 'myspecialexport.tab' var textData = 'load of data...' var success = plugins.file.writeTXTFile(fileNameSuggestion, textData); if (!success) application.output('Could not write file.'); // For file-encoding parameter options (default OS encoding is used), http://download.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html // mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp'
writeTXTFile
(file, text_data, charsetname, mimeType)
Sample
var fileNameSuggestion = 'myspecialexport.tab' var textData = 'load of data...' var success = plugins.file.writeTXTFile(fileNameSuggestion, textData); if (!success) application.output('Could not write file.'); // For file-encoding parameter options (default OS encoding is used), http://download.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html // mimeType variable can be left null, and is used for webclient only. Specify one of any valid mime types as referenced here: http://www.w3schools.com/media/media_mimeref.asp'
writeXMLFile
(file, xml_data)
Sample
var fileName = 'form.xml' var xml = controller.printXML() var success = plugins.file.writeXMLFile(fileName, xml); if (!success) application.output('Could not write file.');
writeXMLFile
(file, xml_data, encoding)
Sample
var fileName = 'form.xml' var xml = controller.printXML() var success = plugins.file.writeXMLFile(fileName, xml); if (!success) application.output('Could not write file.');
writeXMLFile
(file, xml_data)
Sample
var fileName = 'form.xml' var xml = controller.printXML() var success = plugins.file.writeXMLFile(fileName, xml); if (!success) application.output('Could not write file.');
writeXMLFile
(file, xml_data, encoding)
Sample
var fileName = 'form.xml' var xml = controller.printXML() var success = plugins.file.writeXMLFile(fileName, xml); if (!success) application.output('Could not write file.');