문제 설명
FTP Python 550 매개변수 잘못된 파일 이름 오류 (FTP Python 550 Parameter Incorrect Filename Error)
Python에서 ftplib를 사용하여 이미지를 업로드하고 있습니다. 다음 오류가 표시될 때까지 모든 것이 잘 작동했습니다.
ftplib.error_perm: 550 매개변수가 잘못되었습니다.
코드는 다음과 같습니다.
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만 사용하면 잘 작동합니다.
도움을 주시면 감사하겠습니다. 감사합니다!
참조 솔루션
방법 1:
Most of the time when using filenames with ftplib, the error is caused because of the :
. Change them to underscores, and it should work correctly.
From
fileNameA = "2020‑04‑08_00:15.png"
to
fileNameA = "2020‑04‑08_00_15.png"
방법 2:
In the process of writing my question, I got it working. However, I thought it would be good to post it anyways to help others that may have this same problem, as I struggled to find the correct answer.
The virtual directory path cannot contain the following character: \, ?, ;, :, @, &, =, +, $, ,, |, ", <, >, *.
The name I had used the : to separate the minutes field.
I found this on a Microsoft Support Page: https://support.microsoft.com/en‑us/help/2505017/an‑error‑occurs‑when‑creating‑an‑ftp‑site‑in‑internet‑information‑serv
(by AxelSariel、Linny、AxelSariel)