Question T19291
Visible to All Users

base64 URL missing from JSON

created a year ago

Hi,

I am using the file upload object to upload files, I am limiting the upload to only pdf(s), and allowing multiple files to upload. A user is having an issue when they upload a file it appears to attach and show the PDF(s) as being attached.

They then submit the form, but when receiving the post request, the file content is missing the base64 url and just shows a newline character.
I have seen and watched the user upload the file and open the file before attaching the file to show that it is a legitimate PDF. There appears to be no issues with the PDF itself. I have had the user try to user different browser as well, with no success.

I am not sure what could be causing this, I haven't seen this particular issue before.

Any assistance would be greatly appreciated.

Thank You!

Answers approved by surveyjs Support

created a year ago

Hello Chris,
It is better to store files in a separate table/storage. Please review examples in this section. I believe that you are using your own server and database.

Thank you,
Andrew
SurveyJS Team

    Show previous comments (3)
    AT AT
    Andrew Telnov a year ago

      Hello Chris,
      We need the steps to reproduce the issue. As I said before, I strongly believe that the problem somewhere in your code since many our customers use our approach and it works well.
      Unfortunately, without seeing your code or test your code it is impossible to tell anything.
      I would make your code working without your server code first, for example using browser local storage. If the code on the client is working then the problem somewhere in your server or on getting data from the server.
      If it doesn't work then obviously our events are not handled correctly and in this case, if you show us this examples with local storage, we will be able to help you with the issue.

      As another option, you can try to use your server code on the client without SurveyJS API and see how it works.

      Thank you,
      Andrew
      SurveyJS Team

        Hi Andrew,

        I am confused by your response. This has nothing to do with the server, even when just attaching a file to front end UI using the surveyjs library, the file attaches as a blank file when it clearly is a valid PDF. This is all i am using and when attaching again the file is blank, even though it is a valid file

        Code
        { "type": "file", "name": "required_files", "requiredIf": "{files_required} = 'yes'", "allowMultiple": true, "acceptedTypes": ".pdf", "waitForUpload": true, "maxSize": 10000000, "needConfirmRemoveFile": true, "validators": [ { type: "expression", expression: "isPDFFile({required_files}) == true", text: "Only PDF files are allowed" } ]}
        AT AT
        Andrew Telnov a year ago

          Hello Chris,
          I have created the example based on your JSON. I load a pdf file and I was able to review it in my Chrome.
          Could you please describe the issue with this JSON.

          Thank you,
          Andrew
          SurveyJS Team