Examples are as follows:
Import botofrom boto import connectionimport OS, mathfrom Filechunkio import filechunkio# fill in the id and keyconn = bot O.CONNECT_S3 () print conn# fill in your buckets Namebucket = Conn.get_bucket () print bucket# your file path want to Uploadsou Rce_path = './' source_size = Os.stat (source_path). St_sizeprint source_sizemp = Bucket.initiate_multipart_upload ( Os.path.basename (source_path)) chunk_size = 524288000chunk_count = Int (Math.ceil (source_size/chunk_size)) for I in Range (Chunk_count + 1): print i offset = chunk_size * I bytes = min (chunk_size, source_size-offset) with Filechunkio (Source_path, ' R ', Offset=offset, bytes=bytes) as FP: mp.upload_part_from_file (FP, part_num=i + 1) Mp.complete_upload () print ' OK '
Reference Page http://boto.readthedocs.org/en/latest/s3_tut.html
Amazon S3 upload Large file python