code: def put_file(up_token, key, file_path, params=None,
               mime_type='application/octet-stream', check_crc=False,
               progress_handler=None, upload_progress_recorder=None, keep_last_modified=False):
      
      ret = {}
      size = os.stat(file_path).st_size
      # fname = os.path.basename(file_path)
      with open(file_path, 'rb') as input_stream:
          file_name = os.path.basename(file_path)
          modify_time = int(os.path.getmtime(file_path))
          if size > config._BLOCK_SIZE * 2:
              ret, info = put_stream(up_token, key, input_stream, file_name, size, params,
                                     mime_type, progress_handler,
                                     upload_progress_recorder=upload_progress_recorder,
                                     modify_time=modify_time, keep_last_modified=keep_last_modified)
          else:
              crc = file_crc32(file_path)
              ret, info = _form_put(up_token, key, input_stream, params, mime_type,
                                    crc, progress_handler, file_name,
                                    modify_time=modify_time, keep_last_modified=keep_last_modified)
      return ret, info
docs: 上传文件到七牛
  
      Args:
          up_token:         上传凭证
          key:              上传文件名
          file_path:        上传文件的路径
          params:           自定义变量，规格参考 http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
          mime_type:        上传数据的mimeType
          check_crc:        是否校验crc32
          progress_handler: 上传进度
          upload_progress_recorder: 记录上传进度，用于断点续传
  
      Returns:
          一个dict变量，类似 {"hash": "<Hash string>", "key": "<Key string>"}
          一个ResponseInfo对象