Question T22522
Visible to All Users

Multiple File Upload Limit

created 5 days ago

Hi,

For the free survey tool, when using the 'File Upload' question type with the file source set to 'Local File or Camera' and enabling multiple file uploads, are there any limits on the number of photos respondents can upload?

Your guidance on this would be greatly appreciated. Looking forward to your response.

Answers approved by surveyjs Support

created 5 days ago

Hello,
A file upload doesn't have any special option to limit the number of uploaded files. You may wish to handle this from code. Implement the SurveyModel.onUploadFiles function to handle file uploads and prevent users from uploading more than the specified number of photos.

Let us know if you have any further questions.

    Comments (3)

      Hi,

      Can you show how to set a limit on the number of photos that can be uploaded for a question?

      For example, I want to allow a maximum of 10 photos.

      Thank you.

        Hi,
        Can you show how to set a limit on the number of photos that can be uploaded for a question?
        For example, I want to allow a maximum of 10 photos.
        Thank you.

          Hello,
          Unfortunately, we don't have a particular example which shows how to limit the number of uploaded files. The general idea is to count the number of uploaded files and send the options.callback([], error) callback from the survey.onUploadFiles function when the number of uploaded files is greater than 10.

          • Obtain already uploaded files using the File Upload question's value;
          • Obtain the currently uploaded files within the onUploadFiles using the options.files parameter.

          You may review the following demo to learn how to handle file uploads: File Upload.

          Let me know if you require further assistance.