Progress on storing user images
This commit is contained in:
@@ -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
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ if (Meteor.isServer && Meteor.settings.useS3) {
|
||||
collectionName,
|
||||
storagePath,
|
||||
onBeforeUpload,
|
||||
onAfterUpload,
|
||||
debug = Meteor.isProduction,
|
||||
allowClientCode = false,
|
||||
}){
|
||||
@@ -54,7 +55,10 @@ if (Meteor.isServer && Meteor.settings.useS3) {
|
||||
collectionName,
|
||||
storagePath,
|
||||
onBeforeUpload,
|
||||
onAfterUpload(fileRef){
|
||||
onAfterUpload(fileRef) {
|
||||
// Call the provided afterUpload hook first
|
||||
onAfterUpload(fileRef);
|
||||
|
||||
// Start moving files to AWS:S3
|
||||
// after fully received by the Meteor server
|
||||
|
||||
|
||||
Reference in New Issue
Block a user