Add file size validation of 20mb

This commit is contained in:
Rotimi Best
2023-08-11 00:52:06 +01:00
parent 512b6b1902
commit 539bf9c418
3 changed files with 11 additions and 3 deletions
@@ -105,6 +105,14 @@ export const actions = {
});
}
if (formData.file?.size > 20 * 1024 * 1024) {
return fail(400, {
success: false,
type: 'FILE_TOO_LARGE',
message: 'File is too large'
});
}
const { file, lessonId } = formData;
console.log('file', file);
console.log('lessonId', lessonId);