Closed AnuRam123 closed 4 years ago
It looks like the program is trying to download an object named /Users/.../.../dummy.txt
, but I think you only wanted to download dummy.txt
instead. I'd check that you're calling get_item()
with the correct item_name
that only has the file name and not a full path.
I tried with the name as well
both create and get failed
never mind it was my bad , I had the wrong name closing this issue
I am trying to use python https://cloud.ibm.com/docs/services/cloud-object-storage/libraries?topic=cloud-object-storage-python#using-python
I am able to get buckets, create buckets and even items within buckets. I am unable to create files or read contents.
This the code def get_item(bucket_name, item_name): print("Retrieving item from bucket: {0}, key: {1}".format(bucket_name, item_name)) try: file = cos.Object(bucket_name, item_name).get() print("File Contents: {0}".format(file["Body"].read())) except ClientError as be: print("CLIENT ERROR: {0}\n".format(be)) except Exception as e: print("Unable to retrieve file contents: {0}".format(e))