fix(admin): upload stores object at bucket root so /media/{name} matches the redirected URL
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user