diff options
Diffstat (limited to 'hotline')
| -rw-r--r-- | hotline/file_path.go | 9 | ||||
| -rw-r--r-- | hotline/file_transfer.go | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/hotline/file_path.go b/hotline/file_path.go index a3a13f1..aba3195 100644 --- a/hotline/file_path.go +++ b/hotline/file_path.go @@ -98,6 +98,15 @@ func (fp *FilePath) IsUploadDir() bool { return strings.Contains(strings.ToLower(string(fp.Items[fp.Len()-1].Name)), "upload") } +func (fp *FilePath) IsUserDir() bool { + if fp.Len() == 0 { + return false + } + + return strings.HasPrefix(string(fp.Items[0].Name), "~") +} + + func (fp *FilePath) Len() uint16 { return binary.BigEndian.Uint16(fp.ItemCount[:]) } diff --git a/hotline/file_transfer.go b/hotline/file_transfer.go index e8acbb3..386b24a 100644 --- a/hotline/file_transfer.go +++ b/hotline/file_transfer.go @@ -319,7 +319,7 @@ func UploadHandler(rwc io.ReadWriter, fullPath string, fileTransfer *FileTransfe // handler should have returned an error to the client indicating there was an existing file present. _, err := os.Stat(fullPath) if err == nil { - return fmt.Errorf("existing file found: %s", fullPath) + // return fmt.Errorf("existing file found: %s", fullPath) } if !errors.Is(err, fs.ErrNotExist) { |