Question T2711
Visible to All Users

Is there a way to universally set all file questions within a survey to not store data as text?

created 5 years ago

Right now, I have to manually edit each file question and set "storeDataAsText" to false. Is there any way to do this universally for all the file questions within a survey so we don't accidentally forget to do it for one? I only see the edit setting for the individual question.

Clipboard-File-1.png

Thank you!
Scott

Answers approved by surveyjs Support

created 5 years ago (modified 5 years ago)

Hello,

You can change the default value via the following code:

JavaScript
Survey.Serializer.removeProperty("file", "storeDataAsText"); Survey.Serializer.addProperty("file", { name: "storeDataAsText:boolean", default: false });

Here is the working sample - https://plnkr.co/edit/NOekVhqXmdm93uUDBx6l?p=preview

Thanks, Serge
SurveyJS Team

    Show previous comments (3)

      Hello,

      As you can see, this example uses version 1.1.12, the latest version is 1.1.13.

      Thanks, Serge
      SurveyJS Team

        I upgraded to 1.1.13 and it's working great! Is there anything that might break in our survey or creator that I should look out for with this upgrade?

        Scott

          Hello Scott,
          We do our best to support backward compatibility in our libraries.

          Thank you,
          Andrew
          SurveyJS Team