- def split_source_file():
- """
- 对文件进行分片
- :return:
- """
- part_number = 1
- index_list = [0]
- while CHUNK_SIZE * part_number < MULTIPART_UPLOAD_FILE_SIZE:
- index_list.append(CHUNK_SIZE * part_number)
- part_number += 1
- if part_number > 10000:
- print ("分片数 %s 已超过最大允许分片数 10000,请调整分片大小." % part_number)
- sys.exit(-1)
- return index_list
|