Implemented archive upload handling

This commit is contained in:
Stefan Zermatten
2022-06-07 23:01:06 +02:00
parent 385ac17812
commit 28934baac9
13 changed files with 139 additions and 196 deletions

View File

@@ -57,7 +57,7 @@ if (Meteor.isServer && Meteor.settings.useS3) {
onBeforeUpload,
onAfterUpload(fileRef) {
// Call the provided afterUpload hook first
onAfterUpload(fileRef);
onAfterUpload?.(fileRef);
// Start moving files to AWS:S3
// after fully received by the Meteor server
@@ -221,6 +221,7 @@ if (Meteor.isServer && Meteor.settings.useS3) {
collectionName,
storagePath,
onBeforeUpload,
onAfterUpload,
debug = Meteor.isProduction,
allowClientCode = false,
}){
@@ -228,11 +229,12 @@ if (Meteor.isServer && Meteor.settings.useS3) {
collectionName,
storagePath,
onBeforeUpload,
onAfterUpload,
debug,
allowClientCode,
});
if (Meteor.isServer){
if (Meteor.isServer) {
// Use the normal file system to read files
collection.readJSONFile = async function(file){
const fileString = await fsp.readFile(file.path, 'utf8');