From 0727496601a9918c8131c56f62419bfac7ac589a Mon Sep 17 00:00:00 2001 From: Ramires Viana <59319979+ramiresviana@users.noreply.github.com> Date: Mon, 13 Jul 2020 18:59:48 +0000 Subject: [PATCH] fix: remove incomplete uploaded files --- http/resource.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/http/resource.go b/http/resource.go index 95224083..2fd6cf04 100644 --- a/http/resource.go +++ b/http/resource.go @@ -127,6 +127,10 @@ var resourcePostPutHandler = withUser(func(w http.ResponseWriter, r *http.Reques return nil }, action, r.URL.Path, "", d.user) + if err != nil { + _ = d.user.Fs.RemoveAll(r.URL.Path) + } + return errToStatus(err), err })