Custom Previews for File Upload Questions

Edit in →

SurveyJS File Upload questions support the file preview functionality out of the box (see the File Upload demo). This example demonstrates how you can override this functionality and implement custom file previews if required. Read more...

Themes
Color palette
Question appearance
Sorry, we can't retrieve the data from server. Please comeback later.

SurveyJS File Upload questions support the file preview functionality out of the box (see the File Upload demo). This example demonstrates how you can override this functionality and implement custom file previews if required.

To implement custom file previews, follow the steps below:

  1. Disable built-in file previews.
    Set the File Upload question's showPreview property to false.

  2. Render a custom preview.
    Implement SurveyModel's onAfterRenderQuestion event handler to modify the File Upload question markup using JavaScript. In this demo, the event handler adds a <div> element to the bottom of the question. When users select one or multiple files for upload, this <div> displays "Download file" and "Remove file" buttons per uploaded file.

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.

Why we use cookies.

This site uses cookies to make your browsing experience more convenient and personal. Cookies store useful information on your computer to help us improve the efficiency and relevance of our site for you. In some cases, they are essential to making the site work properly. By accessing this site, you consent to the use of cookies.

For more information, refer to DevSoft Baltic’ Terms of Use & Privacy Statement.

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.