mirror of
https://github.com/9001/copyparty.git
synced 2025-10-12 03:22:20 -06:00
fix ftp append (#914)
previously, the target file would always be unlinked upon upload resume, contrary to what the client expects (open for append). when a client sends an APPE, pyftpdlib will `ftp_STOR(file, "a")` which is something that should be allowed within the ftp-wt grace period
This commit is contained in:
parent
f2caab6119
commit
33b0cd5a34
|
@ -251,7 +251,7 @@ class FtpFs(AbstractedFS):
|
|||
|
||||
if w and need_unlink:
|
||||
if td >= -1 and td <= self.args.ftp_wt:
|
||||
# within permitted timeframe; unlink and accept
|
||||
# within permitted timeframe; allow overwrite or resume
|
||||
do_it = True
|
||||
elif self.args.no_del or self.args.ftp_no_ow:
|
||||
# file too old, or overwrite not allowed; reject
|
||||
|
@ -268,6 +268,8 @@ class FtpFs(AbstractedFS):
|
|||
if not do_it:
|
||||
raise FSE("File already exists")
|
||||
|
||||
# Don't unlink file for append mode
|
||||
elif "a" not in mode:
|
||||
wunlink(self.log, ap, VF_CAREFUL)
|
||||
|
||||
ret = open(fsenc(ap), mode, self.args.iobuf)
|
||||
|
|
Loading…
Reference in a new issue