Upload to S3 failed

default discord avatar
quandn
3 months ago

Hi everyione, I have the payload config like bellow


let adapter = s3Adapter({


config: {


endpoint: process.env.S3_ENDPOINT,


forcePathStyle: true,


region: process.env.S3_REGION,


credentials: {


accessKeyId: process.env.S3_ACCESS_KEY_ID,


secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,


},


},


bucket: process.env.S3_BUCKET,


})



export default buildConfig({


serverURL: process.env.SERVER_URL,


cors: "*",


admin: {


user: Collection.Slug.User,


},


collections: Collection.List,


globals: Single.List,


typescript: {


outputFile: path.resolve(

dirname, 'payload-types.ts'),
},
// graphQL: {
// schemaOutputFile: path.resolve(

dirname, 'generated-schema.graphql'),


// },


localization: {


locales: [


'en',


'es',


'de',


],


defaultLocale: 'en',


fallback: true,


},


plugins: [


swagger({}),


computeBlurhash(),


webp(),


formBuilder({


formSubmissionOverrides: {


access: {


admin: () => true,


}


}


}),


rbac({


collections: [Collection.Slug.User],


roles: Object.values(Role),


defaultRoles: [Role.Viewer],


}),


search({


collections: Collection.Searchable,


defaultPriorities: {


pages: 10,


posts: 20,


},


}),


cloudStorage({


collections: {


media: {


adapter,


disableLocalStorage: true,


disablePayloadAccessControl: true


},


},


}),


nestedDocs({


collections: []


}),


]


})


But when I upload the media It return fail Error: Input file is missing /src/media/file_name

    Open the post
    Continue the discussion in Discord
    Like what we're doing?
    Star us on GitHub!

    Star

    Connect with the Payload Community on Discord

    Discord

    online

    Can't find what you're looking for?

    Get help straight from the Payload team with an Enterprise License.