Skip to content

EXDEV: cross-device link not permitted, rename 'C:/.../Temp/upload_xxxx' -> 'D:/projectPath/filename.png' #42

Description

@xyz-dev-ops

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);
...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions