Creating a File Uploader
A File Uploader lets users of your application select and upload local files, whose data can be manipulated by KnowledgeKube.
Implementation:
- Switch to the Definition tab.
- Add a File Uploader-type question to a question group.
- Use the Question Text field to define the text you want to appear on the upload button.
- Click Save Question.
Once your question has been saved three parameters attributes will be applied: MaxNumberOfFiles, MaxFileSizeKB and AllowedFileFormats.
- (Optional) To change the behaviour of the file uploader, edit the question's attributes to change the default values.
- (Optional) Manually add parameters for further customisation, in addition to the default parameters that have been automatically added to the uploader.
Optionally add the following parameters:
- ModelVariable - This parameter can be used if you want to save a comma-separated list of all uploaded files in a variable. Use the name of the intended variable as the parameter's value.
- Refresh - This parameter can be used to determine if a postback will occur when the upload button is clicked. Uploaders are set to refresh by default, so you only need to create this parameter if you want to turn the postback off, which you can do by setting the parameter value to False.
- ShowList - This parameter can be used to display a list of all files that have been uploaded with the question in the current session. To do this, set the parameter value to True.
File data uploaded to the current session will be lost when the session ends (for example, if the current browser window is closed). While it still exists, there are a number of tasks that can be performed using the session data, all of which are achieved using the WithUploadedItems function.