|
|
@ -17,10 +17,14 @@ func (ctrl UploadCtrl) New(c *gin.Context) {
|
|
|
|
if err := c.ShouldBindJSON(&uploadForm); err != nil {
|
|
|
|
if err := c.ShouldBindJSON(&uploadForm); err != nil {
|
|
|
|
c.JSON(http.StatusNotAcceptable, gin.H{
|
|
|
|
c.JSON(http.StatusNotAcceptable, gin.H{
|
|
|
|
"status": http.StatusNotAcceptable,
|
|
|
|
"status": http.StatusNotAcceptable,
|
|
|
|
"error": err,
|
|
|
|
"error": "could not parse form",
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
c.Abort()
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fmt.Println(uploadForm)
|
|
|
|
|
|
|
|
|
|
|
|
// Create unique id
|
|
|
|
// Create unique id
|
|
|
|
id := ksuid.New()
|
|
|
|
id := ksuid.New()
|
|
|
|
up.ID = id.String()
|
|
|
|
up.ID = id.String()
|
|
|
|