Image Upload in Vapor 3 using PostgreSQL

后端 未结 3 1697
没有蜡笔的小新
没有蜡笔的小新 2021-01-04 11:16

I\'m following this guys Martin Lasek Tutorials and now i\'m at \"image upload\". It seems that no one has the answer to the question \"How do you upload images i Vapor 3\"

3条回答
  •  [愿得一人]
    2021-01-04 11:24

    In order for req.content.decode(Question.self) to work, your model have to conforms to the Content protocol which is Vapor encapsulation of Codable + other encoding/decoding stuff.

    Did you add it to your Question model?

    something like that:

    extension Question: Content {}
    

提交回复
热议问题