Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

295
Views
Directus v9 file-type validations before upload

Is there any way to validate or limit what file-type/ extensions could be uploaded before it actually gets uploaded?

I've tried using a couple of custom-hooks but they all just went through.

Hooks tried:

  • files.create.before
  • items.create.before
module.exports = function registerHook({ exceptions }) {
  const { InvalidPayloadException } = exceptions;
  return {
    "files.create.before": async function (input) {
      console.log(input);
      throw new InvalidPayloadException("title");
    },
  };
};
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!