Skip to content

Commit 9780828

Browse files
committed
Cleanup uploaded file close #13
1 parent 4715610 commit 9780828

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM ubuntu:latest
33
ENV XCADDY_VERSION=0.3.4 \
44
GOLANG_VERSION=20.7 \
55
APPPORT=:2011 \
6-
UPLOADER_VERSION=0.13
6+
UPLOADER_VERSION=0.14
77

88
COPY docker-files /
99

upload.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
)
1717

1818
const (
19-
Version = "0.13"
19+
Version = "0.14"
2020
)
2121

2222
func init() {
@@ -161,6 +161,7 @@ func (u *Upload) Provision(ctx caddy.Context) error {
161161
zap.String("response_template", u.ResponseTemplate),
162162
zap.String("notify_method", u.NotifyMethod),
163163
zap.String("notify_url", u.NotifyURL),
164+
zap.Bool("CreateUuidDir", u.CreateUuidDir),
164165
zap.String("capath", u.MyTlsSetting.CAPath),
165166
zap.Bool("insecure", u.MyTlsSetting.InsecureSkipVerify),
166167
)
@@ -200,6 +201,10 @@ func (u Upload) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp
200201
return caddyhttp.Error(http.StatusRequestEntityTooLarge, max_size_err)
201202
}
202203

204+
// cleanup uploaded files see
205+
// https://github.com/git001/caddyv2-upload/issues/13
206+
defer r.MultipartForm.RemoveAll()
207+
203208
// FormFile returns the first file for the given file field key
204209
// it also returns the FileHeader so we can get the Filename,
205210
// the Header and the size of the file

0 commit comments

Comments
 (0)