Add root dir
All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 55s

This commit is contained in:
Alexandre Bruyant 2024-01-07 13:20:52 +01:00
parent d6484243e3
commit f81ceeb17c

View File

@ -7,6 +7,7 @@ import (
"io/fs" "io/fs"
"mime/multipart" "mime/multipart"
"net/http" "net/http"
"net/textproto"
"os" "os"
"path/filepath" "path/filepath"
@ -71,6 +72,12 @@ func main() {
defer mwriter.Close() defer mwriter.Close()
defer writer.Close() defer writer.Close()
h := make(textproto.MIMEHeader)
h.Set("Content-Disposition",
fmt.Sprintf(`form-data; name="file"; filename="%s"`, path))
h.Set("Content-Type", "application/x-directory")
mwriter.CreatePart(h)
err = filepath.Walk(path, func(innerPath string, info fs.FileInfo, err error) error { err = filepath.Walk(path, func(innerPath string, info fs.FileInfo, err error) error {
if err != nil { if err != nil {
return err return err