Progress on storing user images

This commit is contained in:
Stefan Zermatten
2022-04-25 16:16:17 +02:00
parent 6b724cf365
commit 3e97baaaaa
10 changed files with 532 additions and 33 deletions

View File

@@ -9,9 +9,10 @@ const UserImages = createS3FilesCollection({
return 'Please upload with size equal or less than 10MB';
}
// Allow common image extensions
if (/gif|png|jpe?g|webp/i.test(file.extension || '')) {
if (!/gif|png|jpe?g|webp/i.test(file.extension || '')) {
return 'Please upload an image file only';
}
return true
}
});