survey-library icon indicating copy to clipboard operation
survey-library copied to clipboard

Upload Files Trigger

Open Grubiopa opened this issue 1 year ago • 5 comments

Are you requesting a feature, reporting a bug or asking a question?

It's a bug that occurs in versions 1.9 - We upload to survey-vue: 1.9.132

Last previous version tested that works: 1.8.29

What is the current behavior?

The survey.onUploadFiles.add is not trigger when a file need to be upload

image

And no logs are shown.

What is the expected behavior?

Trigger the method onUploadFiles

How would you reproduce the current behavior (if this is a bug)?

Trying to upload files with version 1.8.29 and later upgrading the version

Provide the test code and the tested page URL (if applicable)

Test code

this.survey.onUploadFiles.add((survey, options) => { console.log("Entra al onuploadfiles"); const promises: Promise[] = []; options.files.forEach(file => { const p = this.$vlf.setItem(${options.name}/${file.name}, file); promises.push(); });

  Promise.all(promises).then(() => {
    setTimeout(this.setVisivilityOfNoChosenFileLabel, 100);
    options.callback(
      'success',
      options.files.map(file => {
        return { file, content: `${options.name}/${file.name}` };
      })
    );
  });
});
---------------------------
json
-------

{ "type": "file", "name": "Create and Upload the HLD for the Data Source onboarding here", "isRequired": true, "storeDataAsText": false, "maxSize": 0 }

Specify your

  • browser: Chrome
  • browser version: Versión 122.0.6261.69 (Build oficial) (64 bits)
  • surveyjs platform (angular or react or jquery or knockout or vue): VUE
  • surveyjs version: 1.9.132

Grubiopa avatar Feb 28 '24 10:02 Grubiopa

The vue version is "vue": "^2.6.14",

Grubiopa avatar Feb 28 '24 10:02 Grubiopa

Can you share a minimal live example illustrating the issue?

tsv2013 avatar Mar 11 '24 14:03 tsv2013

Hello @Grubiopa, I just tested the File Upload (Vue) demo on my end and didn't get any issues. The survey.onUploadFiles event was correctly invoked.

If you require further assistance, please send us a problematic demo for research.

Thanks

JaneSjs avatar Mar 13 '24 09:03 JaneSjs

https://github.com/surveyjs/survey-library/assets/14932026/011e18ad-7d3a-4b55-a70a-fab9f8c58cae

Grubiopa avatar Mar 13 '24 11:03 Grubiopa

while is not seeing is the selection of the file

Grubiopa avatar Mar 13 '24 11:03 Grubiopa