Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-file write support #196

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion packages/envd/internal/api/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func processFile(r *http.Request, path string, part *multipart.Part, user *user.
func resolvePath(part *multipart.Part, paths *UploadSuccess, u *user.User, params PostFilesParams) (string, error) {
var pathToResolve string

if params.Path != nil {
if params.Path != nil && *params.Path != "" {
0div marked this conversation as resolved.
Show resolved Hide resolved
pathToResolve = *params.Path
} else {
pathToResolve = part.FileName()
Expand Down Expand Up @@ -142,6 +142,7 @@ func resolvePath(part *multipart.Part, paths *UploadSuccess, u *user.User, param

return filePath, nil
}

func (a *API) PostFiles(w http.ResponseWriter, r *http.Request, params PostFilesParams) {
defer r.Body.Close()

Expand Down