I have upgraded my Admin Bro to version 3 and set up file upload feature but when I would like to submit an article with a dropped image I get upload Errors. The same thing goes when I get back to the old version of admin bro and used the one that I wrote through components. I cannot figure out what's exactly going wrong.
this is the error I get when I submit an article with Image.
const AdminBro = require('admin-bro');
const { Blog } = require('../../models/Blog');
const { sort, timestamps } = require('../sort');
const uploadFeature = require('@admin-bro/upload');
/** @type {AdminBro.ResourceOptions} */
const options = {
sort,
properties: {
...timestamps,
slug: {
position: 0,
},
description: {
isVisible: { list: false, edit: true, filter: false, show: true },
position: 1,
components: {
edit: AdminBro.bundle('../components/custom-fonts.edit.tsx')
}
},
tags: {
isVisible: { list: false, edit: true, filter: true, show: true },
position: 8
},
keywords: {
isVisible: { list: false, edit: true, filter: true, show: true },
position: 9,
type: [String],
},
draftMode: {
isVisible: { list: true, edit: true, filter: true, show: true }
},
_id: {
isVisible: { list: false, edit: false, filter: false, show: false },
},
}
};
module.exports = {
options,
features: [
uploadFeature({
provider: { local: { bucket: 'public/uploads' } },
properties: {
key: 'uploadedFile.path',
bucket: 'uploadedFile.folder',
mimeType: 'uploadedFile.type',
size: 'uploadedFile.size',
filename: 'uploadedFile.filename',
file: 'uploadFile',
}
})
],
resource: Blog,
};
app.use('/uploads', express.static('uploads'));
and I also made a directory by the name of upload on the root folder of my app.
so thankful for supporting this amazing admin panel.
Hello dear SoftwareBrothers,
I have upgraded my Admin Bro to version 3 and set up file upload feature but when I would like to submit an article with a dropped image I get upload Errors. The same thing goes when I get back to the old version of admin bro and used the one that I wrote through components. I cannot figure out what's exactly going wrong.
this is the error I get when I submit an article with Image.
My Blog js
my app.js
and I also made a directory by the name of upload on the root folder of my app.
so thankful for supporting this amazing admin panel.