FTP Python 550 参数不正确的文件名错误
FTP Python 550 Parameter Incorrect Filename Error
我在 Python 上使用 ftplib 上传图像。一切正常,直到它开始给我这个错误:
ftplib.error_perm: 550 The parameter is incorrect.
代码如下:
fileNameA = "2020-04-08_00:15.png" # This one gives the error
fileNameB = "test.png" # This one works well
cmd = "STOR " + fileName
f.storbinary(cmd, file)
当它尝试使用名字(生成的)上传文件时出现错误。但是,如果我只使用 test.png 效果很好。
如有任何帮助,我们将不胜感激。谢谢!
在写问题的过程中,我成功了。但是,我认为无论如何 post 帮助可能遇到同样问题的其他人会很好,因为我一直在努力寻找正确的答案。
The virtual directory path cannot contain the following character:
\, ?, ;, :, @, &, =, +, $, ,, |, ", <, >, *.
我使用 : 分隔分钟字段的名称。
我在 Microsoft 支持页面上找到了这个:https://support.microsoft.com/en-us/help/2505017/an-error-occurs-when-creating-an-ftp-site-in-internet-information-serv
大多数情况下,当使用 ftplib 文件名时,错误是由 :
引起的。将它们更改为下划线,它应该可以正常工作。
来自
fileNameA = "2020-04-08_00:15.png"
至
fileNameA = "2020-04-08_00_15.png"
我在 Python 上使用 ftplib 上传图像。一切正常,直到它开始给我这个错误:
ftplib.error_perm: 550 The parameter is incorrect.
代码如下:
fileNameA = "2020-04-08_00:15.png" # This one gives the error
fileNameB = "test.png" # This one works well
cmd = "STOR " + fileName
f.storbinary(cmd, file)
当它尝试使用名字(生成的)上传文件时出现错误。但是,如果我只使用 test.png 效果很好。
如有任何帮助,我们将不胜感激。谢谢!
在写问题的过程中,我成功了。但是,我认为无论如何 post 帮助可能遇到同样问题的其他人会很好,因为我一直在努力寻找正确的答案。
The virtual directory path cannot contain the following character: \, ?, ;, :, @, &, =, +, $, ,, |, ", <, >, *.
我使用 : 分隔分钟字段的名称。
我在 Microsoft 支持页面上找到了这个:https://support.microsoft.com/en-us/help/2505017/an-error-occurs-when-creating-an-ftp-site-in-internet-information-serv
大多数情况下,当使用 ftplib 文件名时,错误是由 :
引起的。将它们更改为下划线,它应该可以正常工作。
来自
fileNameA = "2020-04-08_00:15.png"
至
fileNameA = "2020-04-08_00_15.png"