keystonejs / keystone-classic

Node.js CMS and web app framework
http://v4.keystonejs.com
MIT License
14.64k stars 2.2k forks source link

Build S3 upload name when not present #4871

Closed Tathanen closed 5 years ago

Tathanen commented 5 years ago

Description of changes

S3 uploads via the TinyMCE text editor broke somehow, insomuch as all files were uploading with the name undefined, overwriting each other each time you add a new one. It seems like the file.name parameter disappeared somehow. I tried to track down where it went, but any doc I could find (ultimately looking at multer) acted like file.name had never existed in the first place. Which makes no sense, since this code sure used to work, and sure references this mythical parameter.

In the end I've just patched the object to once-again include the name, which restores the correct functionality, and files no longer upload with the name undefined, and no longer overwrite each other.