Add root dir
All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 55s
All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 55s
This commit is contained in:
parent
d6484243e3
commit
f81ceeb17c
7
main.go
7
main.go
@ -7,6 +7,7 @@ import (
|
||||
"io/fs"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/textproto"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@ -71,6 +72,12 @@ func main() {
|
||||
defer mwriter.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 {
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user