Make file uploads of CSV actually save to disk
This commit is contained in:
parent
0d55eb1da4
commit
6716bc68c9
27 changed files with 5459 additions and 37 deletions
10
rmo/image.go
10
rmo/image.go
|
|
@ -5,14 +5,20 @@ import (
|
|||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/userfile"
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// ServeImageByUUID reads an image with the given UUID from disk and writes it to the HTTP response
|
||||
func getImageByUUID(w http.ResponseWriter, r *http.Request) {
|
||||
uid := chi.URLParam(r, "uuid")
|
||||
if uid == "" {
|
||||
u := chi.URLParam(r, "uuid")
|
||||
if u == "" {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
uid, err := uuid.Parse(u)
|
||||
if err != nil {
|
||||
http.Error(w, "Failed to parse uuid", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
userfile.PublicImageFileToResponse(w, uid)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue