fix stupid

This commit is contained in:
Samuel Lorch 2024-06-23 04:16:14 +02:00
parent 68093dc543
commit f2580bb8ff

View file

@ -94,7 +94,7 @@ func handleUpload(w http.ResponseWriter, r *http.Request) {
// MaxBytesReader closes the underlying io.Reader on its Close() is called
defer src.Close()
err = os.MkdirAll(filepath.Base(path), 0775)
err = os.MkdirAll(filepath.Dir(path), 0775)
if err != nil {
slog.ErrorContext(r.Context(), "Creating Folder", "err", err)
http.Error(w, "Creating Folder: "+err.Error(), http.StatusInternalServerError)