#TypeError: Cannot read properties of undefined (reading 'mime')

3 messages · Page 1 of 1 (latest)

slow kestrel
#

Trying to upload a .stl file to payload

hot wagon
#

@slow kestrel Can we check out your upload collection?

slow kestrel
#
ModalFile.ts

import { CollectionConfig } from "payload/types";
import path from "path";

const ModelFile: CollectionConfig = {
  slug: "modalfile",
  admin: {},
  upload: {
    staticDir: path.resolve(__dirname, "../../modal"),
  },
  fields: [],
};

export default ModelFile;
 const modalfile = await payload.create({
          collection: "modalfile",
          data: {},
          filePath: lpath,
        });