# Files added in Uppy after adding restrictions

**URL:** <https://community.transloadit.com/t/files-added-in-uppy-after-adding-restrictions/16548>\
**Category:** Uppy\
**Created:** [March 20, 2023, 12:31pm UTC](https://community.transloadit.com/t/files-added-in-uppy-after-adding-restrictions/16548 "2023-03-20T12:31:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NinjaCoderDotCom](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/ninjacoderdotcom/32/822_2.png) [@NinjaCoderDotCom](https://community.transloadit.com/u/NinjaCoderDotCom)\
**Post date:** [March 20, 2023, 12:31pm UTC](https://community.transloadit.com/t/files-added-in-uppy-after-adding-restrictions/16548/1 "2023-03-20T12:31:00Z")

</div>

Hello, everyone  
Hope you are doing good,

I have been using uppy with basic drag and drop funtionality in my react project. Now, I want to add some restriction of **maximum number of files user can add and maximum size of file can be of 3GB.**

Till now the process was that first I was hitting my API of media creation in **onBeforeFileUpload** ( Media creation api is for adding some details in file meta and then take that file to server, create a encrypted media id and then add the details in the DB accordingly).

Now, If some files fails due to restriction they show me in my media list. I tried to remove the media in my **restriction-failed** event but I am unable to get file.meta.mediaId as the process is async.

I tried using uppy event **restriction-passed** which I found on some website. I am not sure if that event is included or not as It is neither present in uppy’s documentation nor working when I tried to use it. Also, in OnBeforeFileAdded when I try to get files object which it the parameter passed in **onBeforeFIleAdded** all I get are the files that pass through the restrictions.

What should I do? Is there any way to get all the files that are just selected and added and have not gone through all other processes?
