Click or drag to resize

Vault Class

"aras.vault" instance of the class can be used in custom JavaScript code. Vault provides batch file uploading/downloading capabilities together with related file manipulation routines.

Namespace:  Aras.Client.Controls.Public
Syntax
JavaScript
Aras.Client.Controls.Public.Vault = function();

Type.createClass(
	'Aras.Client.Controls.Public.Vault');

The Vault type exposes the following members.

Constructors
  NameDescription
Public methodVault
Top
Methods
  NameDescription
Public methodaddFileToDownloadList
Add the specified file URL to the download list. Is not supported because multiple downloading cannot be performed without extensions
Public methodaddFileToList
Add the specified file URL to the fileList.
Public methodclearClientData
Clear all userdata values.
Public methodclearDownloadList
Clears download file list. Is not supported.
Public methodclearFileList
Clears fileList.
Public methoddeleteFile
Delete the file from the local file system specified by the argument, which is a fully qualified path to the file. Is not supported because it works with files system directly.
Public methoddirectoryExists
Gets a value indicating whether the directory exists. Is not supported because it works directly with files system
Public methoddownloadFile
Download file from fileUrl to working directory with specified credentials and post data. To use this method call [M:SetLocalFileName].
Public methoddownloadFileAndExecute
Method that downloads file from web url, save it in users working directory and if user want opens it with appropriate program. If the same file already exists at the working directory, file not downloading anew. Is not supported because it works with files system directly.
Public methoddownloadFiles
Download files from downloadFileList to working directory with specified credentials and post data. To use this method call [M:addFileToDownloadList]. Multiple files downloading is not supported. Use [M:downloadFile] instead.
Public methodfileClose
Closes the readers and the writers and releases any system resources associated with the them. Is not supported because it works directly with files system
Public methodfileCreate
Creates or overwrites the specified file. Is not supported because it works directly with files system
Public methodfileCreateWithSaveAsDialog
Creates or overwrites the specified file and show SaveAsDialog. Is not supported because it works directly with files system
Public methodfileExists
Gets a value indicating whether a file exists. Is not supported because it works directly with files system
Public methodfileOpenAppend
Opens file with access to append material to a file. Is not supported because it works directly with files system
Public methodfileOpenWrite
Opens file with access to write material to a file. Is not supported because it works directly with files system
Public methodfileWriteLine
Writes a string followed by a line terminator to the text stream. Is not supported because it works directly with files system
Public methodgetClientData
Gets userdata (form fields) for uploading.
Public methodgetFileChecksum
Gets checksum of the current file.
Public methodgetFileFieldName
Gets current field name for file (send() method). Default value is vault_file Is not supported. Was used to get ID of a file that is sent through sendFile method
Public methodgetFileSize
Gets the size of the current file.
Public methodgetLastError
Get the error message from the last operation.
Public methodgetOS
Returns the string defining the operating system the applet is running on. Is not supported. Use navigator.userAgent to detect Windows platform.
Public methodgetParentDir
Gets parent directory. Is not supported because it works directly with files system
Public methodgetResponse
Returns the Response property, which is set with the server response data from the upload() method call.
Public methodgetWorkingDir
Get applet's current working directory (where files are to be downloaded into). Is not supported because it works with files system directly.
Public methodmkDir
Creates a directory structure on the local file system.
Mode: download. Is not supported because it works directly with files system
Public methodreadBase64
Reads the string of base64 encoding bytes from the offset position to the offset + count of the stream.
Public methodreadText
Reads the stream from the current position to the end of the stream.
Public methodselectFile
Displays a file selection dialog box that allows the user to browse the local file system and select a file. The WorkingDir property for the applet is also set if the user browses to a directory. The working directory for the dialog box is initialized to the working directory for the applet.
Public methodselectFolder
Displays a folder selection dialog box that allows the user to browse the local file system and select a folder. Filename property is set to null Is not supported because it works directly with files system
Public methodselectSavePath
Displays a SaveFile dialog box, that allows to browse local file system and select a file path for "save" operation. initialPath parameter used to setup initial directory and filename. dialogTitle string will be displayed in title bar. Is not supported because it works directly with files system
Public methodsendFile
Send file from clientData to specified url from working directory. Is not supported because it works with files system directly. There is no access to files system without extensions anymore.
Public methodsendFiles
Send files from clientData to specified url.
Public methodsendFilesAsync
Send files from clientData to specified url in asynchronous mode
Public methodsetClientData
Set userdata (form fields) for uploading.
Mode: upload.
Public methodsetFileFieldName
Sets field name for file (send() method). Default value is vault_file Is not supported. Was used to set ID of a file that is sent through sendFile method
Public methodsetFileName
Sets the Filename property. This can be used to set the file name as an alternative to the SelectFile() method. Is not supported because it works directly with files system
Public methodsetLocalFileName
Sets local file name.
Public methodsetWorkingDir
Sets the local working directory for the applet (where files are to be downloaded into).
Initially working directory can be initialized from {@link #pWORKINGDIR pWORKINGDIR} parameter.
Mode: download. Is not supported because it works directly with files system
Public methodurlDecode
Converts a string that has been encoded for transmission in a URL into a decoded string. Is not supported. Use native decodeURIComponent
Public methodurlEncode
Encodes a URL string. Is not supported. Use native encodeURIComponent
Public methodwriteText
If file exists, writes a string to the stream. Else creates files and writes text. Is not supported because it works directly with files system
Top
Remarks
It has user friendly interface, displays a progress bar during time consuming upload/download process and has warning/error messages system to inform the user about any collisions.
User has a possibility to add/remove files to the batch list, rename files and folders, cancel current job.
User may select files from both local and network-mapped folders, optionally including all sub-folders. Additionally, he can enter any valid network path and browse it in the file selection dialog.

File transfer works over http, SSL (https) with or without proxy. This is achieved by using browser's native connection classes.
And the most attractive feature is the possibility to upload huge files (unlimited file size) with no timeouts or memory leacks (known java bug).
We use all available network traffic, so the transfer will go as fast as your LAN/WAN allows.
You can submit your form data together with the file. It is usually required to send the state information back to the server.

What else can I do with Vault applet that I can't with a usual FILE form input field? - Well, you can control, filter and preprocess the file list that user has selected. You can enable or disable to transfer some file types basing on your application logic, and you can collect additional information related to those files. And finally, you don't need to reload your page while you transferring the files.

We use the standard "multipart/form-data" content encoding, so the applet is compatible with any server-side uploading component. The quality of the server-side component as well as the hard-drive performance will also affect the resulting transfer rate.

See Also