update form

use-redis
Chakib Benziane 5 years ago
parent 1a72909f51
commit 423ba0e52c

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

@ -3,9 +3,10 @@ package storage
import "time"
type File struct {
Name string
SHA256 string
Size int64
Name string `form:"name"`
SHA256 string `form:"sha256"`
Size int64 `form:"size"`
Type string `form:"type"` // MIME type
}
type UploadForm struct {

Loading…
Cancel
Save