I don't know if it is a server or client in this context, but have you looked into using rclone? I think due to the nature of the way it intermediates the S3 API, and involves (re)downloading files for some operations, rclone is probably either, or both, depending on what you're doing and how.