diff options
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 +} |