Model upload fields in Sophora.
File
A File input field is designed to enable the upload of any kind of file. This field type operates only with childnodes of the type sophora-nt:binarydata
, which is why you have to add that as a valid child node name in the childnode configuration. To enable the saving of filenames, configure document.file.saveFilePath
in the configuration document. There are two parameters for a File input field. With both of them you can restrict what kind of files can be uploaded. If you do not set a value yourself, there won't be a limitation.
ParametersParameter | Description | Range of Values |
---|
Maximum Size (in kB) | Configure a maximum file size in kB. | Positive integers |
Extensions | If you want to restrict the set of file formats that can be uploaded with the File field, you can list all permitted document extensions in a comma separated list (e.g. pdf,png,jpg ). | Any file extension |
File Upload
The input field type File Upload allows the user to transfer a file to a FTP or SFTP server. In the property configuration, the server and a folder have to be configured. The user can select a local file that will be uploaded to the configured location. File uploads run in the background an can be canceled. Once the upload is finished, the remote path will be stored in the property of the document.
ParametersParameter | Description | Default Value | Possible Values |
---|
Protocol | Protocol for transferring data to the target server. | FTP | FTP, SFTP |
Target Server | The address of the file server to which files will be uploaded. Optionally, you can additionally specify a port. If you don't, the well-known port for FTP (21) or SFTP (22) will be used. | localhost:21 | Hostnames or IPv4 addresses, optionally ending with :port . |
Target Folder | The folder on the file server to which the files should be saved. | . | A file path on the server. It may contain placeholders (see below). |
Target Filename | The filename under which the files will be stored. | ${filename} | A string which the selected server will accept as a filename. May contain placeholders. |
Username | The username to log in to the file server. | anonymous | Arbitrary text. Ideally a username which exists on the server. |
Password | The password for the given user to log in to the file server. | guest | Arbitrary text. Ideally the password of the selected user. |
Character Encoding | The character encoding to be used by the FTP control connection. | ISO-8859-1 | Valid character encodings for FTP. |
The parameters "target folder" and "target filename" may contain placeholders which will be resolved when an upload will be performed.
PlaceholdersPlaceholder | Description |
---|
${creationDate} | The creation date of the document, in the form YYYY-MM-DD. If the document has not been saved yet, the current date is used. |
${creationDate:day} | The day of the creation date of the document (two digits). If the document has not been saved yet, the current date is used. |
${creationDate:month} | The month of the creation date of the document (two digits). If the document has not been saved yet, the current date is used. |
${creationDate:year} | The year of the creation date of the document (four digits). If the document has not been saved yet, the current date is used. |
${externalId} | The external ID of the document. If the document has not been saved yet, a random string is used. |
${fileName} | The name of the file being uploaded (only valid for the Target Filename parameter). |
${fileExtension} | The filename extension of the file being uploaded (only valid for the parameter Target Filename). |
Browser Tab parameters | See here |