|
@@ -39,11 +39,10 @@ func FileUploadHandle(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
|
originFilename := fileHeader.Filename
|
|
originFilename := fileHeader.Filename
|
|
now := time.Now()
|
|
now := time.Now()
|
|
- timePoint := fmt.Sprintf("%v%v%v%v%v%v", now.Year(), now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second())
|
|
|
|
- var filename string = originFilename + "-" + timePoint
|
|
|
|
|
|
+ timePoint := fmt.Sprintf("%v-%v-%v-%v-%v-%v", now.Year(), now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second())
|
|
|
|
+ var filename string = timePoint + "-" + originFilename
|
|
|
|
|
|
// check file path
|
|
// check file path
|
|
-
|
|
|
|
fmt.Println(os.Getwd())
|
|
fmt.Println(os.Getwd())
|
|
fp := Conf.FilePath
|
|
fp := Conf.FilePath
|
|
_, err = os.Stat(fp)
|
|
_, err = os.Stat(fp)
|
|
@@ -55,7 +54,6 @@ func FileUploadHandle(w http.ResponseWriter, r *http.Request) {
|
|
code = 2
|
|
code = 2
|
|
msg = err.Error()
|
|
msg = err.Error()
|
|
return
|
|
return
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|