summaryrefslogtreecommitdiff
path: root/system/admin/upload/upload.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-11-02 01:20:19 -0700
committerSteve Manuel <nilslice@gmail.com>2016-11-02 01:20:19 -0700
commit330c35078d1b12657a373473d1638612f6cbbb8e (patch)
tree3f947037ce9182505763c4ff2fdd4fa609cdfdac /system/admin/upload/upload.go
parent022b3455d5c7a67a2a8fb9d168a54cb95b063df3 (diff)
adding proper padding on month int to dir name for file upload
Diffstat (limited to 'system/admin/upload/upload.go')
-rw-r--r--system/admin/upload/upload.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/system/admin/upload/upload.go b/system/admin/upload/upload.go
index 169bffe..dc6d8cc 100644
--- a/system/admin/upload/upload.go
+++ b/system/admin/upload/upload.go
@@ -45,7 +45,7 @@ func StoreFiles(req *http.Request) (map[string]string, error) {
urlPathPrefix := "api"
uploadDirName := "uploads"
- uploadDir := filepath.Join(pwd, uploadDirName, fmt.Sprintf("%d", tm.Year()), fmt.Sprintf("%d", tm.Month()))
+ uploadDir := filepath.Join(pwd, uploadDirName, fmt.Sprintf("%d", tm.Year()), fmt.Sprintf("%02d", tm.Month()))
err = os.MkdirAll(uploadDir, os.ModeDir|os.ModePerm)
// loop over all files and save them to disk