diff options
author | Wolfy-J <[email protected]> | 2018-06-13 14:06:13 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-13 14:06:13 +0300 |
commit | c8e8afe79611941ce50453ee7dfae82d7915e9c4 (patch) | |
tree | af79f850176807bab545546c7a161a5cf7015d73 /service/http/uploads.go | |
parent | b58bbaa615f38916860e06db27e2ab31b0eb2d08 (diff) |
more upload tests
Diffstat (limited to 'service/http/uploads.go')
-rw-r--r-- | service/http/uploads.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/service/http/uploads.go b/service/http/uploads.go index 99484f4b..4d661682 100644 --- a/service/http/uploads.go +++ b/service/http/uploads.go @@ -128,3 +128,17 @@ func (f *FileUpload) Open(cfg *UploadsConfig) error { return err } + +// exists if file exists. +func exists(path string) bool { + _, err := os.Stat(path) + if err == nil { + return true + } + + if os.IsNotExist(err) { + return false + } + + return false +} |