Question T13704
Visible to All Users

Download during read only preview

created 2 years ago

I'm using showPreview() in readonly mode to view the results of someone taking a survey.
Since everything is readonly - the icon for the file that was uploaded is not clickable.
I'd like to be able to click that icon to download the file. BUT - I do not want the ability to delete the file - just be able to download.

Is there a preferred way to enable a click event for the file icons? I will write custom download logic in that event.

Answers approved by surveyjs Support

created 2 years ago

Hello Marshall,
You can use the survey.onAfterRenderQuestion event and implement a custom preview for File questions. Please refer to the following demo: File question - custom preview. This example shows how to implement a custom file preview. If you test the configuration demonstrated in that example, you can see that a file icon remains clickable even in a read-only survey mode allowing users to download the file. You can override File question rendering using the onAfterRenderQuestion event and implement the desired functionality.

Should you have any questions or require further assistance, we are here to help.