I am using .net, and I am trying to delete an object from my S3 bucket. I tried the following:
Amazon.S3.AmazonS3Client client = new Amazon.S3.AmazonS3Client(Properties.Settings.Default.AmazonS3VideoSrcKey, Properties.Settings.Default.AmazonS3VideoSrcSecret);
client.DeleteObject(new Amazon.S3.Model.DeleteObjectRequest() { BucketName = "xxxx", Key = "http://....../filename"});
I dont get IsDeleteMarker true.
What can be wrong?
thanks
If you are unable to delete an Amazon S3 bucket, consider the following: Make sure the bucket is empty – You can only delete buckets that don't have any objects in them.
Deleting an objectIn the Buckets list, choose the name of the bucket that you want to delete an object from. Select the check box to the left of the names of the objects that you want to delete. Choose Actions and choose Delete from the list of options that appears.
To delete an object version in a bucket with bucket versioning enabled, Amazon S3 will permanently delete the object version.
Procedure. Right-click over the objects you want to delete, and choose Delete. In the Delete dialog box, select the objects you want to delete from the list.
Short description. You can't delete an S3 bucket using the Amazon S3 console if the bucket contains 100,000 or more objects. You can't delete an S3 bucket using the AWS CLI if versioning is enabled. For more information, see Deleting a bucket.
When you delete a bucket, there may be a delay of up to one hour before the bucket name is available for reuse in a new region or by a new bucket owner. If you re-create the bucket in the same region or with the same bucket owner, there is no delay.
Does your keys have an http://... prefix?
My guess is that you are mistakenly passing a URL instead of a key. Your request should probably look more like this:
client.DeleteObject(new Amazon.S3.Model.DeleteObjectRequest() { BucketName = "xxxx", Key = "filename"});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With