-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
Description
I use Sequelize as Orm and postgresql as db. I wanna to store images in json. When I'm trying to upload a file to a resource, it gives an error to the console
Error: EXDEV: cross-device link not permitted, rename 'C:/.../Temp/upload_xxxx' -> 'D:/projectPath/filename.png'
and doesnt save anything to images field in db. It saves random file called upload_${somenumbers} to Temp folder, although I specified folder by { bucket: path.join(__dirname, '../public') }
adminRouter.js file
...
const adminJs = new AdminJS({
databases: [db],
rootPath: '/admin',
resources: [
{
resource: User,
options: { listProperties: ['id', 'email', 'ava', 'avaTxt', 'images'] },
features: [
uploadFeature({
provider: { local: { bucket: path.join(__dirname, '../public') } },
properties: {
file: 'images.file',
filePath: 'images.path',
filename: 'images.filename',
filesToDelete: 'images.toDelete',
key: 'images.key',
mimeType: 'images.mimeType',
bucket: 'images.bucket',
},
}),
],
},
],
});
...
server.js
...
server.use(express.static('public'));
const adminRouter = require('./Routes/adminRouter');
server.use('/admin', adminRouter);
...
itzTerra and Overk1lls
Metadata
Metadata
Assignees
Labels
No labels