[DUPLICATE] Create a Hook for asset pre-upload to act as a gate

Hi, is there a way to have a hook that triggers synchronously before uploading an asset?.

Use case:

  1. User uploads a video with certain screen size

  2. Hook sends metadata of the video to the hook

  3. Hook responds 400 code if validation is incorrect

  4. Squidex UI fails the asset upload

  5. Nice to have: Alert the user that the video was invalid.

If it helps,
In my case, I get the definition of the schema that should contain the asset with the validation rules. On my front end I check the number of file, size, format, extension etc and warn the user before loading the media on squidex.

I have added validation rules to also check the video size when assigning assets to contents. This does not prevent someone from uploading an incorrect video, but it prevents assigning the video to the content.

Duplicate of: Run a script when Asset is changed

This topic was automatically closed after 2 days. New replies are no longer allowed.