Inheritance Hierarchy
Namespace: Amazon.S3.Model
Assembly: AWSSDK.dll
Version: 2.0.0.3
Syntax
public class DeleteObjectRequest : AmazonWebServiceRequest IRequestEvents
The DeleteObjectRequest type exposes the following members
Constructors
Name | Description | |
---|---|---|
![]() |
DeleteObjectRequest() |
Properties
Name | Description | |
---|---|---|
![]() |
BucketName | The name of the bucket containing the object to delete. |
![]() |
Key | The key identifying the object to delete. |
![]() |
MfaCodes | The MfaCodes Tuple associates the Serial Number and the current Token/Code displayed on the Multi-Factor Authentication device associated with your AWS Account. |
![]() |
VersionId | The identifier for the specific version of the object to be deleted, if required. |
Examples
This example shows how to delete an object.
DeleteObject sample
// Create a client AmazonS3Client client = new AmazonS3Client(); // Create a DeleteObject request DeleteObjectRequest request = new DeleteObjectRequest { BucketName = "SampleBucket", Key = "Item1" }; // Issue request client.DeleteObject(request);
Remarks
To remove a specific version, you must be the bucket owner and you must use the versionId subresource. Using this subresource permanently deletes the version.
If the object you want to delete is in a bucket where the bucket versioning configuration is MFA Delete enabled, you must include specify the MFA serial number and value in the request.
If there isn't a null version, Amazon S3 does not remove any objects.
Version Information
.NET Framework:
Supported in: 4.5, 4.0, 3.5
.NET for Windows Store apps:
Supported in: Windows 8
.NET for Windows Phone:
Supported in: Window Phone 8