TypeError: expected str, bytes or os.PathLike object, not _io.BufferedReader

前端 未结 1 897
孤街浪徒
孤街浪徒 2020-12-31 00:01

I\'m trying to iterate through a group of files in a folder on my local machine and upload only ones where the file names contain \"Service_Areas\" to my FTP site using usin

相关标签:
1条回答
  • 2020-12-31 00:33

    I think it has to do with your second element in storbinary. You are trying to open file, but it is already a pointer to the file you opened in line file = open(local_path,'rb'). So, try to use ftp.storbinary("STOR " + i, file).

    0 讨论(0)
提交回复
热议问题