Overview
This field type is designed to store a single uploaded document within a single field.
Field Illustrated
Field Options
The options listed below are specific to this particular field type.
Security Options
- Allow External Access: If there is an externally enabled report that includes files within this Multiple Files field, individuals viewing the report will have the ability to click on the file names listed and access the underlying files.
- Enable Online Editing - When activated, an edit button will appear next to the documents in this field, allowing users to edit the documents online. Once changes are saved, the updated document will automatically be stored back into the corresponding Multiple Files field. (Note: Documents with special characters, such as apostrophes in the file name, may not be editable)
- Real-Time Virus Scan - Conducts a virus scan on uploaded documents.
Other Options
- File Indexing – Enables file indexing and full-text searching using the Lucene full-text search engine, which is integrated into SmartSimple.
- Create Optimized Image Version: If selected, a small version (thumbnail) will be generated upon image upload. The thumbnail image will be compressed and limited to 1024 pixels in width. The thumbnail can be accessed using the syntax @fieldname.compressedlink@. This feature aims to enhance the loading time of pages displaying numerous high-resolution images.
- Enable Annotation – Permits users to add annotations to uploaded PDF documents within the SmartSimple system.
- Disable Email Button - Removes the functionality for users to email the file directly from within SmartSimple.
- Disable Delete – Restricts the user’s ability to delete any files stored in the field, requiring manager permission for the user to delete an Allow Delete Multiple Files Fields.
- Enable Excel Parsing - Parses an uploaded Excel file and populates mapped fields based on the content of the file.
- File Type Restriction - Utilize this option to specify the only file types permitted for upload, presented in a comma-separated list. Please ensure that file extensions (e.g., txt, jpg, pdf) are in lowercase. Refer to the File Type Restriction page for additional information.
- File Name Restriction - Allows enforcement of a file naming convention for files uploaded to SmartSimple. For further details, see the File Name Restriction page.
- Maximum File Size - A drop-down menu providing options to set a limit on the file upload size.
- Workflow on Upload - Enables the definition of a Workflow that will be initiated whenever a file is uploaded to this field.
Special Field Options
Indexing Multiple and Single File Fields
The Link Multiple File Field and the Link Single File Field both support a file index feature. This feature facilitates the search of documents attached to the field, contingent upon the user having the necessary permissions to access the field.
File Types Supported
- When adding a document to this file, it is imperative to ensure that the document can be indexed for searching. The following document types are supported: Microsoft Word and Excel, Adobe PDF, HTML, and RTF files.
Ensuring that PDF Files are Searchable
- When utilizing PDF files, it is essential to ensure that the files are text-searchable. This functionality can be verified by opening the file with Adobe Acrobat Reader and confirming that the Select Text tool is operable for selecting text from the file.
Indexing after Uploading
- The indexing function is executed upon the first upload of the file. Therefore, if you wish to index a file after it has been uploaded, you must re-index the field. Follow these steps to index the field:
- Locate and edit the Custom Field.
- Select the File Index checkbox.
- Click the Save button.
- Click the File Index button in the action bar.
- Select the option button Re-index all files in this field now!
- Click the Save button.
Disabling a File Index
- To disable the File Index function and cease making attached files searchable, please follow these steps:
- Locate and edit the Custom Field.
- Deselect the File Index checkbox.
- Click the Save button.
- Click the File Index button in the action bar.
- Select the option button Remove index from all files in this field now!
- Click the Save button.
Display Additional File Attributes for PDF Documents
- If the Single File field is intended to store a PDF file, a Read Only - System Variables field can also be created to display additional attributes about the file (referred to as Meta Data).
- The additional attributes that can be extracted and displayed include: author, creator, producer, keywords, subject, title, number of pages, creation date, and modified date.
- For details on how to accomplish this, see Display Additional File Attributes for PDF Documents.
Emailing Document
- The document stored within this file can be emailed from within SmartSimple by clicking the Lookup... button (which may have been relabeled using the Button Label option described above) followed by clicking Email.
Variables
The following extensions can be utilized with Single File fields:
- .value: Represents the path (URL) of the file.
- .filename: Displays the name of the file (including extension such as .pdf, .doc, etc.).
- .numOfpages: If a PDF file is stored in the field, the number of pages in the PDF document will be shown.
- .uploadlink: The URL that can be employed to upload a file to the field.
Examples
Display the number of pages:
@Contract Document.numOfpages@
Upload file function using hyperlink:
<a href="@Additional Files.uploadlink@" target="_blank">Click Here to upload</a>
Upload file function as a button:
<input class="Button" type="button" value="Upload File" />
Calculate the length of the uploaded filename (for use in validation; this will work for non-PDF file types and will return 0 if no file is uploaded).
<!--@sscalculation(length("@Budget Upload.filename@"))-->
Notes
- Commas in the file names of uploaded files will be automatically replaced with underscore characters ("_") to prevent errors during JavaScript execution.
Number of Pages
- The number of pages that a PDF file in a Single File field contains can be evaluated as follows
- This script will prevent saving or submitting a record unless there is a valid PDF stored in the Applicant CV single file field, and it must be 10 or less pages in length. (sbfunc is not run on Save Draft, so the record can be saved with Save Draft, if available)
function sbfunc(frm){ var aCV=parseInt("@Applicant CV.numofpages@"); if(aCV<1){ alert("You must upload a PDF of the Applicant CV"); return false; }if(aCV>10){ alert("The Applicant CV must be less than 10 pages in length."); return false; }
The same can be achieved with Submit Logic
@level1.Applicant CV.numofpages@>0
- The number of files (PDF or otherwise) in a Multiple Files field can be evaluated using numoffiles.
function sbfunc(frm){ var supDocs=parseInt("@Supporting Documents.numoffiles@"); if(supDocs>10){ alert("You are not permitted to include more than 10 supporting documents. Please remove at least "+(supDocs-10)+" files"); return false; } return true; }
Encrypted
- If a PDF file that has been uploaded is encrypted, it will not be possible to attach it to a Web Page View using ssattach.
- Attempting to attach an encrypted PDF will not hinder the conversion of the Web Page View to PDF. The encrypted file will simply be omitted from the final PDF document.
- Note: When inserting multiple PDFs into the center of a Web Page View: If you are utilizing the numofpages attribute to determine the page location for inserting a PDF into a Web Page View, any preceding documents that are excluded due to encryption will still be counted in the page total, thereby disrupting the sequence of subsequent PDF insertions.
Single File Custom Field
- For a PDF uploaded to a Single File field, the following script will trigger an alert indicating that the file should be replaced. This alert will appear after the page has been saved.
- Note: It is not feasible to trigger an alert immediately upon file upload; the alert will only occur when the page reloads after the record has been saved.
function onloadfunc(){ if("@Applicant CV.[encrypted]@"=="Encrypted") alert("The PDF version of the applicant CV is encrypted and cannot be attached to the application. The file must be replaced with a PDF that does not have the 'Content Copying' restriction in place."); }