From 330c35078d1b12657a373473d1638612f6cbbb8e Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Wed, 2 Nov 2016 01:20:19 -0700 Subject: adding proper padding on month int to dir name for file upload --- system/admin/upload/upload.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3