fix(admin): upload stores object at bucket root so /media/{name} matches the redirected URL

This commit is contained in:
sam
2026-09-10 07:24:59 +10:00
parent 423901c80d
commit 644ee9f292

View File

@@ -48,7 +48,7 @@ func (s *Site) mediaUpload(w http.ResponseWriter, r *http.Request) {
return return
} }
ctype := fh.Header.Get("Content-Type") ctype := fh.Header.Get("Content-Type")
ok, perr := s.Media.Put("media/" + name, ctype, data) ok, perr := s.Media.Put(name, ctype, data)
if !ok || perr != nil { if !ok || perr != nil {
http.Error(w, "upload failed", http.StatusInternalServerError) http.Error(w, "upload failed", http.StatusInternalServerError)
return return