Creates a directory named path

This commit is contained in:
mohanak 2022-09-06 17:01:58 +05:30
parent 2c9e5fe47a
commit a65282a270

View File

@ -15,6 +15,7 @@ import (
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
"sync"
"time"
@ -601,6 +602,10 @@ func (c *Context) SaveUploadedFile(file *multipart.FileHeader, dst string) error
}
defer src.Close()
if err = os.MkdirAll(filepath.Dir(dst), 0750); err != nil {
return err
}
out, err := os.Create(dst)
if err != nil {
return err