|
|
|
@ -164,11 +164,14 @@ func SendZip(w http.ResponseWriter, r *http.Request) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
tpath := "" |
|
|
|
// 选中的路径,可以为空
|
|
|
|
//wtculpath := r.Form["curpath"]
|
|
|
|
|
|
|
|
wtculpath := r.Form["curpath"] |
|
|
|
if wtculpath != nil { |
|
|
|
tpath = wtculpath[0] |
|
|
|
} |
|
|
|
// 实际路径
|
|
|
|
realFilePath := filepath.Join(config.G.FilePath, "") |
|
|
|
realFilePath := filepath.Join(config.G.FilePath, tpath) |
|
|
|
|
|
|
|
// zip 文件名
|
|
|
|
zpFileName := "BIU_" + time.Now().Format("20060102_150405") + ".zip" |
|
|
|
@ -240,18 +243,19 @@ func SendHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
} |
|
|
|
|
|
|
|
data := struct { |
|
|
|
DeviceName string |
|
|
|
//Rundir string
|
|
|
|
DeviceName string |
|
|
|
Rundir string |
|
|
|
IsDir bool |
|
|
|
FileName string |
|
|
|
DownloadPath string |
|
|
|
UrlPath string |
|
|
|
Files []os.DirEntry |
|
|
|
}{ |
|
|
|
DeviceName: config.G.DeviceName, |
|
|
|
//Rundir: config.G.FilePath,
|
|
|
|
DeviceName: config.G.DeviceName, |
|
|
|
Rundir: config.G.FilePath, |
|
|
|
DownloadPath: downloadPath, |
|
|
|
UrlPath: strings.TrimSuffix(r.URL.Path, "/"), |
|
|
|
//UrlPath: strings.TrimSuffix(r.URL.Path, "/"),
|
|
|
|
UrlPath: r.URL.Path, |
|
|
|
} |
|
|
|
|
|
|
|
if fileInfo.IsDir() { |
|
|
|
|