@@ -76,14 +76,6 @@ func (u *Upload) Provision(ctx caddy.Context) error {
76
76
zap .String ("msg" , "no Root Directory specified (root_dir), will use {http.vars.root}" ))
77
77
}
78
78
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
-
87
79
if u .FileFieldName == "" {
88
80
u .logger .Warn ("Provision" ,
89
81
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
277
269
278
270
// read all of the contents of our uploaded file into a
279
271
// byte array
280
- //fileBytes, io_err := ioutil.ReadAll(file)
281
272
fileBytes , io_err := io .Copy (tempFile , file )
282
273
if io_err != nil {
283
274
u .logger .Error ("Copy Error" ,
@@ -287,8 +278,6 @@ func (u Upload) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp
287
278
zap .Object ("request" , caddyhttp.LoggableHTTPRequest {Request : r }))
288
279
return caddyhttp .Error (http .StatusInternalServerError , io_err )
289
280
}
290
- // write this byte array to our temporary file
291
- //tempFile.Write(fileBytes)
292
281
293
282
u .logger .Info ("Successful Upload Info" ,
294
283
zap .String ("requuid" , requuid ),
0 commit comments