Image bin data

1. upload_bin_data(image_id, myFile)

Upload local image file to server

Parameters: image_id, myFile

Name Type Description
image_id string the target image id
myFile file a file you want to upload

Parameter example:

# First try to get the cloud
files = {'file':open('like.bin', 'rb')}
cloud.image.upload_bin_data(image_id, myFile=files)
# do sth ...

Return value: None

2. download_bin_data(image_id)

Download image bin data from server

Parameters: image_id

Name Type Description
id string target image id

Return value: response

Return value example:

# you should get the file object from the response
image_id = ...
resp = cloud.image.download_bin_data(image_id)
for s in resp.iter_content():
    # do sth ...

results matching ""

    No results matching ""