Hi all...

I am trying to upload 4 files on a local disk, onto a remote ftp server. All of them are in the same folder(in local machine).
I am using the storbinary function of ftplib.

Following are the file sizes:

1-- 70 KB
2-- 60 KB
3-- 73 KB
4-- 8,100 KB

The first 3 files get uploaded successfully, but while trying to upload the 4th file, an ftplib.error_perm exception is thrown, which says "500, sorry file is not supported for uploading"

I don't think there is any permission constraint, since the first three images get uploaded without problem, and all of them are in the same folder.

Is there any limit on file size that can be uploaded by storbinary()??

plz help me..

8 MB is not a very large size. You could try and upload the file with filezilla first to see if the FTP server accepts this file.

thanks for a reply......

ya i tried by uploading the file through filezilla ,filezilla will upload that file but i cant upload through script????

Difficult help because others have not same problem. I can do without problem:

>>> ysisoft = ftplib.FTP('ftp.ysisoft.com', user,password)
>>> ysisoft.storbinary('STOR PyScripter-v2.4.1-Setup.exe',open("k:/Lataukset/PyScripter-v2.4.1-Setup.exe"))
'226 Transfer complete'

After checking actually it did not transfer all.

-rw-r--r--   1 ******** ftpusers   114110 Mar 28 01:18 PyScripter-v2.4.1-Setup.exe

I forgot to include 'rb' for open:

>>> with open("k:/Lataukset/PyScripter-v2.4.1-Setup.exe") as filein:
	program = filein.read()

>>> len(program)
>>> with open("k:/Lataukset/PyScripter-v2.4.1-Setup.exe", 'rb') as filein:
	program = filein.read()

>>> len(program)

So like this it works for me finally:

>>> with open("k:/Lataukset/PyScripter-v2.4.1-Setup.exe", 'rb') as filein:
	ysisoft.storbinary('STOR PyScripter-v2.4.1-Setup.exe',filein)

'226 Transfer complete'

>>> ysisoft.dir('PyS*')
-rw-r--r--   1 ******** ftpusers  4324886 Mar 28 01:25 PyScripter-v2.4.1-Setup.exe
>>>>>> ysisoft.close()

Edited 5 Years Ago by pyTony: n/a

plz help me ......

The FTP error 500 is described as "syntax error, unrecognized command", and may include a too long command line, so it may have something to do with the name of the file, or the path to the file.

This article has been dead for over six months. Start a new discussion instead.