Python FTP filename invalid error
<p>I'm trying to upload a file using ftp in python, but I get an error saying:</p>

<pre><code>ftplib.error_perm: 550 Filename invalid
</code></pre>

<p>when I run the following code:</p>

<pre><code>ftp = FTP('xxx.xxx.x.xxx', 'MY_FTP', '')
ftp.cwd("/incoming")
file = open('c:\Automation\FTP_Files\MaxErrors1.json', 'rb')
ftp.storbinary('STOR c:\Automation\FTP_Files\MaxErrors1.json', file)
ftp.close()
</code></pre>

<p>I've checked that the file exists in the location I specified, does anyone know what might be causing the issue?</p>

<p>you should upload file without absolute path in ftp server
for example :</p>

<pre><code>import ftplib
session = ftplib.FTP('server.address.com','USERNAME','PASSWORD')
file = open('kitten.jpg','rb')                  # file to send
session.storbinary('STOR kitten.jpg', file)     # send the file
file.close()                                    # close file and FTP
session.quit()
</code></pre>

python ftp