diff --git a/fssc/fssc b/fssc/fssc index ac3ce52..5cebb19 100644 Binary files a/fssc/fssc and b/fssc/fssc differ diff --git a/fssc/internal/handler/handler.go b/fssc/internal/handler/handler.go index 6f8e2e3..64e1b81 100644 --- a/fssc/internal/handler/handler.go +++ b/fssc/internal/handler/handler.go @@ -120,7 +120,7 @@ func Supfile(w http.ResponseWriter, r *http.Request) { // 替换 反斜杠 bbpath := strings.Replace(bpath, "/", "\\", -1) // 拼装, 文件的实际地址 - ziprl := filepath.Join(config.G.FilePath, bbpath, "/", bfile) + ziprl := filepath.Join(config.G.FilePath, "/", bbpath, "/", bfile) // 创建udp 渠道发送数据 message := fmt.Sprintf("%s%s%s", "xdml|", bbpath, "|sender") @@ -129,26 +129,6 @@ func Supfile(w http.ResponseWriter, r *http.Request) { } -// 文件服务 -func FileServerHandler(w http.ResponseWriter, r *http.Request) { - currentPath := config.G.FilePath - - fileInfo, err := os.Stat(currentPath) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - basePath := filepath.Base(currentPath) - if fileInfo.IsDir() { - path := r.URL.Path[len("/download/"+basePath):] - fullPath := filepath.Join(currentPath, path) - http.ServeFile(w, r, fullPath) - } else { - http.ServeFile(w, r, currentPath) - } -} - // udp 方式发送zip文件 func SendZip(w http.ResponseWriter, r *http.Request) { r.ParseForm()