0

Within my Python script I am using ftplib. However, I am encountering the error_perm: 500 ? error upon performing the below operation:

filename = '31379-den-katastrofy-2-konec-sveta-film-2005.html'
ftp = ftplib.FTP('ftpupload.net')
ftp.login('onavt_24441681', 'rte22133') 
ftp.cwd('htdocs')
print(ftp.pwd())
print(os.getcwd())
uploadfile = open('/content/drive/MyDrive/path/31379-den-katastrofy-2-konec-sveta- 
film-2005.html', 'rb')
ftp.storlines('STOR' + filename, uploadfile)

I can't seem to figure how what is wrong. Any pointers on what should I adjust to get rid of the error?

BiOS
  • 2,282
  • 3
  • 10
  • 24
Aur Itar
  • 21
  • 4
  • Does this answer your question? [Python :raise error\_perm, resp ftplib.error\_perm: 500?](https://stackoverflow.com/questions/32261278/python-raise-error-perm-resp-ftplib-error-perm-500) – programandoconro Feb 26 '21 at 08:32
  • Pleas add the entire stack trace, it makes it easier to help. and dont post your password here – Bendik Knapstad Feb 26 '21 at 08:33
  • This is not real password. It is just random simbols – Aur Itar Feb 26 '21 at 08:34
  • @AurItar, storlines() requires a string-command as first parameter, whose syntax should be `STOR filename`. You can check from my answer below. Let me know if it works! – BiOS Feb 26 '21 at 15:54

1 Answers1

0

Don't forget the space after the STOR command.

Update the last line with:

ftp.storlines('STOR ' + filename, uploadfile)

And it should work

BiOS
  • 2,282
  • 3
  • 10
  • 24