summaryrefslogtreecommitdiff
path: root/service/http/uploads.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-13 14:06:13 +0300
committerWolfy-J <[email protected]>2018-06-13 14:06:13 +0300
commitc8e8afe79611941ce50453ee7dfae82d7915e9c4 (patch)
treeaf79f850176807bab545546c7a161a5cf7015d73 /service/http/uploads.go
parentb58bbaa615f38916860e06db27e2ab31b0eb2d08 (diff)
more upload tests
Diffstat (limited to 'service/http/uploads.go')
-rw-r--r--service/http/uploads.go14
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
+}