Keystone JS: S3 image uploads being auto-renamed with temporary string

后端 未结 1 1844
后悔当初
后悔当初 2021-01-26 09:27

I\'m pretty new to Keystone as I recently inherited a codebase on a project that used it. We were locked into version 0.2.42 so I just updated to the latest, version 0.3.12 and

相关标签:
1条回答
  • 2021-01-26 09:58

    I figured this out with a bit of help over on Github so I figured I'd answer my own question here.

    The "Post" Keystone list that the previous programmer had written only had type defined for the image field. I added that filename option as well:

    image: {
        type: Types.S3File,
        filename: function(item, filename, originalname){
            return originalname;
        }
    },
    

    The original file name is now preserved.

    0 讨论(0)
提交回复
热议问题