[Reactive Multiple File Upload] How can I add additional check on the file size and number of files uploaded?

Forge Component
(4)
Published on 16 Jun by José Pedro Proença
4 votes
Published on 16 Jun by José Pedro Proença

Hi Team,

I have a requirement to limit the file upload size to 25 MB and the number of files uploaded at a  time to 25. I am very new to Javascript and not sure how I can get this done.

Could you please suggest any leads that could be helpful.


Regards,

Amrutha

Hi Amrutha, are you trying to change the file upload limitations in written in the Forge component or are you trying to resize a photo yourself right now? Resize an image here.

Hi Amrutha Varshini T S :)

Thanks a lot for your feedback! We think your request makes a lot of sense so we'll add the possibility to set a size limit per file.

We are also looking into what possibilities do we have to also allow you to disable the input after a certain number of files have been uploaded.

I'll let you know as soon as we've updated the component. I'm working on it as we speak.

Once again, thanks a lot for the feedback

José Pedro Proença wrote:

Hi Amrutha Varshini T S :)

Thanks a lot for your feedback! We think your request makes a lot of sense so we'll add the possibility to set a size limit per file.

We are also looking into what possibilities do we have to also allow you to disable the input after a certain number of files have been uploaded.

I'll let you know as soon as we've updated the component. I'm working on it as we speak.

Once again, thanks a lot for the feedback

Hello again :)


Please, go ahead and check the updated demo https://jose-proenca.outsystemscloud.com/MultipleFileUploadReactiveDemo/FileUpload

I've added the possibility to set a file limit.


I'm working know on allowing you to deactivate the file upload widget. As soon as that is done I'll update the Forge component.


Let me know what you think


José Pedro Proença wrote:

José Pedro Proença wrote:

Hi Amrutha Varshini T S :)

Thanks a lot for your feedback! We think your request makes a lot of sense so we'll add the possibility to set a size limit per file.

We are also looking into what possibilities do we have to also allow you to disable the input after a certain number of files have been uploaded.

I'll let you know as soon as we've updated the component. I'm working on it as we speak.

Once again, thanks a lot for the feedback

Hello again :)


Please, go ahead and check the updated demo https://jose-proenca.outsystemscloud.com/MultipleFileUploadReactiveDemo/FileUpload

I've added the possibility to set a file limit.


I'm working know on allowing you to deactivate the file upload widget. As soon as that is done I'll update the Forge component.


Let me know what you think


Hi José Pedro Proença,


Thank you for your quick response. Looks great :)


Cheers!!


Amrutha Varshini T S wrote:

José Pedro Proença wrote:

José Pedro Proença wrote:

Hi Amrutha Varshini T S :)

Thanks a lot for your feedback! We think your request makes a lot of sense so we'll add the possibility to set a size limit per file.

We are also looking into what possibilities do we have to also allow you to disable the input after a certain number of files have been uploaded.

I'll let you know as soon as we've updated the component. I'm working on it as we speak.

Once again, thanks a lot for the feedback

Hello again :)


Please, go ahead and check the updated demo https://jose-proenca.outsystemscloud.com/MultipleFileUploadReactiveDemo/FileUpload

I've added the possibility to set a file limit.


I'm working know on allowing you to deactivate the file upload widget. As soon as that is done I'll update the Forge component.


Let me know what you think


Hi José Pedro Proença,


Thank you for your quick response. Looks great :)


Cheers!!


We now also allow you to enable/disable the input as you wanted :) You can also check it out on the demo link.

I'll upload this new version later today after doing some further tests.


Solution

José Pedro Proença wrote:

Amrutha Varshini T S wrote:

José Pedro Proença wrote:

José Pedro Proença wrote:

Hi Amrutha Varshini T S :)

Thanks a lot for your feedback! We think your request makes a lot of sense so we'll add the possibility to set a size limit per file.

We are also looking into what possibilities do we have to also allow you to disable the input after a certain number of files have been uploaded.

I'll let you know as soon as we've updated the component. I'm working on it as we speak.

Once again, thanks a lot for the feedback

Hello again :)


Please, go ahead and check the updated demo https://jose-proenca.outsystemscloud.com/MultipleFileUploadReactiveDemo/FileUpload

I've added the possibility to set a file limit.


I'm working know on allowing you to deactivate the file upload widget. As soon as that is done I'll update the Forge component.


Let me know what you think


Hi José Pedro Proença,


Thank you for your quick response. Looks great :)


Cheers!!


We now also allow you to enable/disable the input as you wanted :) You can also check it out on the demo link.

I'll upload this new version later today after doing some further tests.


Hi Amrutha Varshini T S

The new version of the Forge component is live! Go ahead and update it :)

Let me know if this helps with your issues and if so, please don't forget to mark this answer as Solution.


 Thank you so much for the great feedback!


Solution

José Pedro Proença wrote:

José Pedro Proença wrote:

Amrutha Varshini T S wrote:

José Pedro Proença wrote:

José Pedro Proença wrote:

Hi Amrutha Varshini T S :)

Thanks a lot for your feedback! We think your request makes a lot of sense so we'll add the possibility to set a size limit per file.

We are also looking into what possibilities do we have to also allow you to disable the input after a certain number of files have been uploaded.

I'll let you know as soon as we've updated the component. I'm working on it as we speak.

Once again, thanks a lot for the feedback

Hello again :)


Please, go ahead and check the updated demo https://jose-proenca.outsystemscloud.com/MultipleFileUploadReactiveDemo/FileUpload

I've added the possibility to set a file limit.


I'm working know on allowing you to deactivate the file upload widget. As soon as that is done I'll update the Forge component.


Let me know what you think


Hi José Pedro Proença,


Thank you for your quick response. Looks great :)


Cheers!!


We now also allow you to enable/disable the input as you wanted :) You can also check it out on the demo link.

I'll upload this new version later today after doing some further tests.


Hi Amrutha Varshini T S

The new version of the Forge component is live! Go ahead and update it :)

Let me know if this helps with your issues and if so, please don't forget to mark this answer as Solution.


 Thank you so much for the great feedback!


Hi José Pedro Proença,

Good day!!

The file size limiter looks great!! Good Job!! :)

Well, I am not sure if I was clear on the second part of my question. I wanted to know if we could set the number of files that could be uploaded at any time to say 25. So when a user tries to upload 26 files, the widget throws an error saying Maximum allowed files is 25, please select lesser files to upload.

You think thats doable?

Cheers!!


Amrutha Varshini T S wrote:

José Pedro Proença wrote:

José Pedro Proença wrote:

Amrutha Varshini T S wrote:

José Pedro Proença wrote:

José Pedro Proença wrote:

Hi Amrutha Varshini T S :)

Thanks a lot for your feedback! We think your request makes a lot of sense so we'll add the possibility to set a size limit per file.

We are also looking into what possibilities do we have to also allow you to disable the input after a certain number of files have been uploaded.

I'll let you know as soon as we've updated the component. I'm working on it as we speak.

Once again, thanks a lot for the feedback

Hello again :)


Please, go ahead and check the updated demo https://jose-proenca.outsystemscloud.com/MultipleFileUploadReactiveDemo/FileUpload

I've added the possibility to set a file limit.


I'm working know on allowing you to deactivate the file upload widget. As soon as that is done I'll update the Forge component.


Let me know what you think


Hi José Pedro Proença,


Thank you for your quick response. Looks great :)


Cheers!!


We now also allow you to enable/disable the input as you wanted :) You can also check it out on the demo link.

I'll upload this new version later today after doing some further tests.


Hi Amrutha Varshini T S

The new version of the Forge component is live! Go ahead and update it :)

Let me know if this helps with your issues and if so, please don't forget to mark this answer as Solution.


 Thank you so much for the great feedback!


Hi José Pedro Proença,

Good day!!

The file size limiter looks great!! Good Job!! :)

Well, I am not sure if I was clear on the second part of my question. I wanted to know if we could set the number of files that could be uploaded at any time to say 25. So when a user tries to upload 26 files, the widget throws an error saying Maximum allowed files is 25, please select lesser files to upload.

You think thats doable?

Cheers!!


Good morning :)

Yes you were clear. My idea to solve that part of the problem was the creation of the input variable to activate or deactivate the input. On your page you could have a count that increments when a file is uploaded and decrements when a file is deleted and you could put something like "numFiles < 25" as the value of the input I mentioned. This way it will deactivate itself when that number of files is reached and reject all other files. 


I'm not sure if it would make sense to put that logic on our side, because I don't know how many people need that and we would like to keep the component simple. Whoever I will talk to my team and let you know if they think it makes sense to put that on a future update! 


Thanks :)