Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
318 views
in Technique[技术] by (71.8m points)

node.js - admin-bro AWS provider dont send the image

i followed the tutorial of admin-bro, i dont get error when i send the image to the provider, but nothing not happen.

my options for "admin" schema, i have field "photo" :

    const options = {
    properties: {
    encryptedPassword: {
        isVisible: false,
    },
    password: {
        type: "password",
    },
    uploadImage: {
        features: [
            uploadFeature({
                provider: {
                    aws: {
                        accessKeyId: process.env.S3_ACCESS_ID,
                        secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
                        Bucket: "blaatkbla-bucket",
                        region:"EU (Paris) eu-west-3"
                    },
                },
                properties: {
                    key: "photo", // to this db field feature will safe S3 key
                    mimeType: "mimeType", 
                validation: {
                    mimeTypes: "application/pdf",
                },
            }),
        ],
        components: {
            edit: AdminBro.bundle("./components/uploadImage"),
        },
    },
     },

what i missing?

this is what i get in the network tab after added success.

{"redirectUrl":"/admin/resources/Admin","notice":{"message":"Successfully created a new record","type":"success"},"record":{"params":{"photo.size":80503,"photo.path":"C:\Users\Roei\AppData\Local\Temp\upload_bd4b1f414e9151574c0f5dd294567aeb","photo.name":"s3.jpg","photo.type":"image/jpeg","photo.mtime":"2021-01-06T13:28:55.975Z","_id._bsontype":"ObjectID","_id.id":{"type":"Buffer","data":[95,245,187,23,136,44,1,105,4,55,217,157]},"email":"sa@wala.ck","username":"dsapo","encryptedPassword":"$argon2i$v=19$m=4096,t=3,p=1$c8ULnpeAPDrNGuGAL43oGQ$iLfL0+tR0Xx5VUiLpT7yQtk/o2MRD2ByBbK0uk21J98","__v":0},"populated":{},"errors":{},"title":"sa@wala.ck","recordActions":[{"name":"show","actionType":"record","icon":"Screen","label":"Show","resourceId":"Admin","guard":"","showFilter":false,"showInDrawer":false,"hideActionHeader":false,"containerWidth":1,"layout":null,"variant":"default","parent":null,"hasHandler":true,"custom":{}},{"name":"edit","actionType":"record","icon":"Edit","label":"Edit","resourceId":"Admin","guard":"","showFilter":false,"showInDrawer":false,"hideActionHeader":false,"containerWidth":1,"layout":null,"variant":"default","parent":null,"hasHandler":true,"custom":{}},{"name":"delete","actionType":"record","icon":"TrashCan","label":"Delete","resourceId":"Admin","guard":"Do you really want to remove this item?","showFilter":false,"component":false,"showInDrawer":false,"hideActionHeader":false,"containerWidth":1,"layout":null,"variant":"danger","parent":null,"hasHandler":true,"custom":{}}],"bulkActions":[{"name":"bulkDelete","actionType":"bulk","icon":"Delete","label":"Delete all","resourceId":"Admin","guard":"","showFilter":false,"showInDrawer":true,"hideActionHeader":false,"containerWidth":"500px","layout":null,"variant":"danger","parent":null,"hasHandler":true,"custom":{}}]}}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...