clien.conf 主要配置
base_path=/home/mj/fastdfs/tracker
tracker_server=x.x.x.x:22122
# pip uninstall fdfs-client-py
# pip install py3fdfs
from fdfs_client.client import Fdfs_client, get_tracker_conf
client_conf = get_tracker_conf(r'<path>/client.conf')
client = Fdfs_client(client_conf)
ret = client.upload_by_filename(r'test.jpg')
print(ret)
"""
ret = {
'Group name': b'group1',
'Remote file_id': b'group1/M00/00/00/test.jpg',
'Status': 'Upload successed.',
'Local file name': 'test.jpg',
'Uploaded size': '338KB',
'Storage IP': b'xx.xx.xx.xx'
}
"""