I'm want to upload a file using Python to an rental FTP server (coreserver). The code is like this
# -*- coding: utf-8 -*-
import ftplib
def ftp_upload(hostname, username, password, upload_src_path, upload_dst_path):
ftp = ftplib.FTP(hostname)
ftp.set_pasv("true")
ftp.login(username, password)
fp = open(upload_src_path, 'rb')
ftp.storbinary(upload_dst_path ,fp)
ftp.close()
fp.close()
hostname = "example.com"
upload_src_path = "/content/drive/My Drive/DSC_0569.JPG"
upload_dst_path = "STOR /public_html/example.com/"
username = "example"
password = "example"
ftp_upload(hostname, username, password, upload_src_path, upload_dst_path)
but error happens like this
error_perm: 550 /public_html/example.com/: Operation not permitted
I tried
STOR /public_html/
STOR /public_html
STOR /public_html/example.com/
STOR /public_html/example.com
STOR /example.com/
STOR /example.com
but the error happens all the time
error_perm: 550 /public_html/example.com/: Operation not permitted
or
error_perm: 550 /public_html/example.com/: Not a regular file
Can anybody help me to solve this problem?