Create Missing Transcode Folders
This commit is contained in:
parent
36fe3202e8
commit
68093dc543
1 changed files with 7 additions and 0 deletions
|
@ -94,6 +94,13 @@ 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)
|
||||
if err != nil {
|
||||
slog.ErrorContext(r.Context(), "Creating Folder", "err", err)
|
||||
http.Error(w, "Creating Folder: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
out, err := os.Create(path)
|
||||
if err != nil {
|
||||
slog.ErrorContext(r.Context(), "Creating File", "err", err)
|
||||
|
|
Loading…
Add table
Reference in a new issue