Bug Report
Calling this:
const filePath = '[...]/filename.geojson';
await payload.create({
collection: 'geofiles',
filePath: tmpFilePath,
data: {}
});
results in the following error:
TypeError: Cannot read properties of undefined (reading 'mime')
at getFileByPath ([...]/node_modules/payload/src/uploads/getFileByPath.ts:16:34)
at async createLocal ([...]/node_modules/payload/src/collections/operations/local/create.ts:65:21)
I'm using Payload 1.6.6.
Possible cause
I believe the problem lies in the the following code const mimetype = fromFile(filePath); (link) which ultimately in the file-type package does this new FileTypeParser().parse(tokenizer);.
FileTypeParser.parse() (link) does not support (geo)JSON.
The file-type states This package is for detecting binary-based file formats, not text-based formats like .txt, .csv, .svg, etc., does this mean that the payload upload system also only supports binary-based file formats?
Bug Report
Calling this:
results in the following error:
I'm using Payload 1.6.6.
Possible cause
I believe the problem lies in the the following code
const mimetype = fromFile(filePath);(link) which ultimately in the file-type package does thisnew FileTypeParser().parse(tokenizer);.FileTypeParser.parse()(link) does not support (geo)JSON.The
file-typestates This package is for detecting binary-based file formats, not text-based formats like .txt, .csv, .svg, etc., does this mean that the payload upload system also only supports binary-based file formats?