Skip to content

Commit f72078c

Browse files
committed
[Upload] Cleanup some code and comments
1 parent 3665b95 commit f72078c

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

upload.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,6 @@ func (u *Upload) Provision(ctx caddy.Context) error {
7676
zap.String("msg", "no Root Directory specified (root_dir), will use {http.vars.root}"))
7777
}
7878

79-
mdall_err := os.MkdirAll(u.DestDir, 0755)
80-
if mdall_err != nil {
81-
u.logger.Error("Provision",
82-
zap.String("msg", "MkdirAll: Error creating destination Directory"),
83-
zap.Error(mdall_err))
84-
return mdall_err
85-
}
86-
8779
if u.FileFieldName == "" {
8880
u.logger.Warn("Provision",
8981
zap.String("msg", "no FileFieldName specified (file_field_name), using the default one 'myFile'"),
@@ -277,7 +269,6 @@ func (u Upload) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp
277269

278270
// read all of the contents of our uploaded file into a
279271
// byte array
280-
//fileBytes, io_err := ioutil.ReadAll(file)
281272
fileBytes, io_err := io.Copy(tempFile, file)
282273
if io_err != nil {
283274
u.logger.Error("Copy Error",
@@ -287,8 +278,6 @@ func (u Upload) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp
287278
zap.Object("request", caddyhttp.LoggableHTTPRequest{Request: r}))
288279
return caddyhttp.Error(http.StatusInternalServerError, io_err)
289280
}
290-
// write this byte array to our temporary file
291-
//tempFile.Write(fileBytes)
292281

293282
u.logger.Info("Successful Upload Info",
294283
zap.String("requuid", requuid),

0 commit comments

Comments
 (0)