Hello, I am trying to seed my database and I am not being able to upload media. How could I do this?
Update: I managed to find the documentation, we need to insert the filePath outside the data; My final solution:
const beer_image = await payload.create<Media>({
collection: 'media',
data: {
description: "Seed Beer"
},
filePath: path.resolve(__dirname, "./seedingImages/beer.jpg") ,
});
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.