X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/8dea0e8234db79daeb40544b4b3426d8ce76f3e5..9004987d8ec11b788f972e6764f875f2d873cfd6:/hotline/transaction_handlers.go diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go index 0812f9a..5773d80 100644 --- a/hotline/transaction_handlers.go +++ b/hotline/transaction_handlers.go @@ -472,9 +472,9 @@ func HandleDeleteFile(cc *ClientConn, t *Transaction) (res []Transaction, err er fileName := string(t.GetField(fieldFileName).Data) filePath := cc.Server.Config.FileRoot + ReadFilePath(t.GetField(fieldFilePath).Data) - path := "./" + filePath + "/" + fileName + path := filePath + fileName - cc.Server.Logger.Debugw("Delete file", "src", filePath+"/"+fileName) + cc.Server.Logger.Debugw("Delete file", "src", path) fi, err := os.Stat(path) if err != nil { @@ -505,8 +505,8 @@ func HandleDeleteFile(cc *ClientConn, t *Transaction) (res []Transaction, err er // HandleMoveFile moves files or folders. Note: seemingly not documented func HandleMoveFile(cc *ClientConn, t *Transaction) (res []Transaction, err error) { fileName := string(t.GetField(fieldFileName).Data) - filePath := "./" + cc.Server.Config.FileRoot + ReadFilePath(t.GetField(fieldFilePath).Data) - fileNewPath := "./" + cc.Server.Config.FileRoot + ReadFilePath(t.GetField(fieldFileNewPath).Data) + filePath := cc.Server.Config.FileRoot + ReadFilePath(t.GetField(fieldFilePath).Data) + fileNewPath := cc.Server.Config.FileRoot + ReadFilePath(t.GetField(fieldFileNewPath).Data) cc.Server.Logger.Debugw("Move file", "src", filePath+"/"+fileName, "dst", fileNewPath+"/"+fileName) @@ -1241,7 +1241,7 @@ func HandleDownloadFolder(cc *ClientConn, t *Transaction) (res []Transaction, er fp := NewFilePath(t.GetField(fieldFilePath).Data) - fullFilePath := fmt.Sprintf("./%v/%v", cc.Server.Config.FileRoot+fp.String(), string(fileTransfer.FileName)) + fullFilePath := fmt.Sprintf("%v%v", cc.Server.Config.FileRoot+fp.String(), string(fileTransfer.FileName)) transferSize, err := CalcTotalSize(fullFilePath) if err != nil { return res, err @@ -1263,7 +1263,7 @@ func HandleDownloadFolder(cc *ClientConn, t *Transaction) (res []Transaction, er // Fields used in the request // 201 File name // 202 File path -// 108 Transfer size Total size of all items in the folder +// 108 transfer size Total size of all items in the folder // 220 Folder item count // 204 File transfer options "Optional Currently set to 1" (TODO: ??) func HandleUploadFolder(cc *ClientConn, t *Transaction) (res []Transaction, err error) {