adminjs
adminjs copied to clipboard
hey did you get it done?
Using
- "admin-bro": "^3.3.0-beta.24"
- "@admin-bro/upload": "^1.2.0-beta.3"
And with the following code:
features: [
uploadFeature({
provider: {
aws: {
bucket: config.s3.bucket,
accessKeyId: config.s3.accessKeyId,
secretAccessKey: config.s3.secretAccessKey,
region: config.s3.region
}
},
properties: {
key: 'keys',
filePath: 'imagePaths'
},
validation: {
mimeTypes: ['image/png', 'image/jpg', 'image/jpeg']
},
multiple: true
})
]
I get the following error:
Error: You cannot upload file for not persisted record. Save record first
at Object.exports.buildRemotePath (C:\Users\Mohamed\Desktop\Self\Identity\Projects\alexengsyndicate-backend\node_modules\@admin-bro\upload\build\features\upload-file\utils\build-remote-path.js:22:15)
at Promise.all.uploadedFiles.map (C:\Users\Mohamed\Desktop\Self\Identity\Projects\alexengsyndicate-backend\node_modules\@admin-bro\upload\build\features\upload-file\factories\update-record-factory.js:36:53)
at Array.map (<anonymous>)
at updateRecord (C:\Users\Mohamed\Desktop\Self\Identity\Projects\alexengsyndicate-backend\node_modules\@admin-bro\upload\build\features\upload-file\factories\update-record-factory.js:35:62)
at prevPromise.then.modifiedResponse (C:\Users\Mohamed\Desktop\Self\Identity\Projects\alexengsyndicate-backend\node_modules\admin-bro\lib\backend\decorators\action\action-decorator.js:147:99)
at process._tickCallback (internal/process/next_tick.js:68:7)
Can you please give a full example for a multiple upload?
Originally posted by @mohamed-nazmi in https://github.com/SoftwareBrothers/adminjs/issues/95#issuecomment-708630040