Delayed File Upload
Delayed file upload is a technique that enables you to postpone file upload until a certain moment. This technique helps save storage space on your server: if a user selects a file and then changes it to another, the first file won't be uploaded. This demo shows how to upload files when a survey is completed. Until that moment, files are stored in a variable as base64-encoded strings.
To implement delayed file upload, program different functionalities within the following event handlers:
onUploadFiles
Add files to a variable that acts as a temporary file storage and load file previews.onClearFiles
Remove all or individual files from the temporary file storage.onComplete
Upload files to a server and save metadata about them as the question value.
For more information, view code listings for Angular, React, Vue, jQuery, or Knockout.
In this demo, files are uploaded to SurveyJS servers from where they are then deleted after a predefined period of time. We strongly encourage you to use your own servers for file uploads when you use SurveyJS to collect sensitive respondent data in your application.