Attaching documents to a questionnaire

 

Documents, images, media, and any file types can be attached to a questionnaire by uploading them from the respondent's computer, and can be retrieved using a Data report.

Creating a question to upload the attachment

To allow a questionnaire to upload a document, create a question and choose the Upload question style:

In the allowed extensions field, enter a list of the document extensions allowed, such as xls,xlsx,doc,docx separated by commas.
In the maximum file size field, enter the largest document size allowed.
Both of these parameters are important to prevent upload denial of service attacks.

Respondent experience

These parameters will create a question that looks like this:

Upload question

The respondent uses the Browse button to find the worksheet, and then presses Upload. The document is uploaded, and the respondent sees a confirmation message:

The respondent can then can proceed to the next page of the questionnaire.

Retrieving the data

When a document is uploaded, a unique identifying number is assigned to it. The original file name and the unique number are stored in the Upload question's field in the database. When the questionnaire data is retrieved using a Data report, responses that have an attached document include a clickable link with the original file name:

Clicking on the Attachment link will cause the document to be downloaded from the server and loaded with the application that is registered for that document's MIME type, such as Excel or Word.

Technical information

The system Administrator must configure ViewsFlash properties "upload.directory" and "upload.maxsize". If these parameters are not specified,they default to /etc/cogix/upload and 1 million, respectively.

The upload.directory parameter must point to a directory where the ViewsFlash application server has been granted file creation, directory creation, and read, write and delete access rights. In a single-server deployment, any directory can be used. In a clustered deployment, this directory must reside on a shared volume, so that attachments gathered from all servers are stored in the same directory and can be accessed by all nodes in the cluster.

Uploaded files are stored in subdirectories named SSS!PPP, where SSS is the Place name and PPP is the questionnaire name.
The files are saved using names RRRRR.ext, where RRR is a random number and .ext is the original file extension.
The generated file name and the original file name are written to the Upload question's field in the database.

The upload.maxsize parameter indicates the size of the largest allowed file upload, in bytes.

 

Next: Branching