docker快速安装fastdfs在上一篇博文中有。
安装依赖
pip install py3Fdfs
配置文件:fastfdfs_client.conf
connect_timeout=30
network_timeout=60
tracker_server = ?.?.?.?:22122
# tracker服务器的端口
http.tracker_server_port = 8080
运行测试
from fdfs_client.client import get_tracker_conf, Fdfs_client
if __name__ == '__main__':
tracker_conf = get_tracker_conf('fastfdfs_client.conf')
client = Fdfs_client(tracker_conf)
result = client.upload_by_filename('1.jpg')
print(result)
del_result = client.delete_file(b'group1/M00/00/00/rBMvdGFBn-mAIC-wAACJgPr49gU830.jpg')
print(result)