Delete object S3

I am using .net and I am trying to remove 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 do not believe IsDeleteMarker true.

What could be wrong?

thanks

+4
source share
1 answer

Do your keys have the http: // ... prefix?

I assume that you are mistakenly passing a URL instead of a key. Your query will probably look like this:

 client.DeleteObject(new Amazon.S3.Model.DeleteObjectRequest() { BucketName = "xxxx", Key = "filename"}); 
+9
source

Source: https://habr.com/ru/post/1391011/


All Articles