在实际上传之前,有什么方法可以验证或限制可以上传的文件类型/扩展名吗?
我尝试过使用几个自定义挂钩,但它们都刚刚通过。
钩子尝试过:
module.exports = function registerHook({ exceptions }) {
const { InvalidPayloadException } = exceptions;
return {
"files.create.before": async function (input) {
console.log(input);
throw new InvalidPayloadException("title");
},
};
};
Run Code Online (Sandbox Code Playgroud)