Exemple #1
0
        public override void DeleteFiles(string domain, string path, string pattern, bool recursive)
        {
            var objToDel = GetS3Objects(domain, path)
                           .Where(x => Wildcard.IsMatch(pattern, Path.GetFileName(x.Key)));

            using (AmazonS3 client = GetClient())
            {
                foreach (S3Object s3Object in objToDel)
                {
                    if (QuotaController != null)
                    {
                        QuotaController.QuotaUsedDelete(_modulename, domain, _dataList.GetData(domain),
                                                        Convert.ToInt64(s3Object.Size));
                    }

                    var deleteRequest = new DeleteObjectRequest
                    {
                        BucketName = _bucket,
                        Key        = s3Object.Key
                    };

                    using (client.DeleteObject(deleteRequest))
                    {
                    }
                }
            }
        }
Exemple #2
0
        private void deleteWithRetry(DeleteObjectRequest request)
        {
            // Retry delete request up to five times
            for (int i = 0; i < properties.S3MaxErrorRetry; i++)
            {
                try
                {
                    // Attempt to delete the object
                    s3.DeleteObject(request);
                    log.Info("Successfully deleted file on S3: " + request.ToString());
                    return;
                }
                catch (AmazonS3Exception exception)
                {
                    log.Debug("Failed to deleted file from S3: " + exception.ToString());
                    Thread.Sleep(properties.S3RetryDelayInterval);
                }
                catch (Exception e) {
                    log.Debug("Failed to deleted file from S3: " + e.ToString());
                    Thread.Sleep(properties.S3RetryDelayInterval);
                }
            }

            throw new AmazonS3Exception("Failed to deleted file from S3");
        }
        /// <summary>
        /// Delete an object from S3.
        /// </summary>
        /// <param name="bucket">The name of the bucket where the object lives.</param>
        /// <param name="key">The name of the key to use.</param>
        public Status delete(string bucket, string key)
        {
            DateTime timestamp = AWSDateFormatter.GetCurrentTimeResolvedToMillis();
            string   signature = makeSignature("DeleteObject", timestamp);

            return(s3.DeleteObject(bucket, key, awsAccessKeyId, timestamp, true, signature, null));
        }
Exemple #4
0
 static void DeletingAnObject()
 {
     try
     {
         DeleteObjectRequest request = new DeleteObjectRequest();
         request.WithBucketName(bucketName)
         .WithKey(keyName);
         using (DeleteObjectResponse response = client.DeleteObject(request))
         {
             System.Net.WebHeaderCollection headers = response.Headers;
             foreach (string key in headers.Keys)
             {
                 Console.WriteLine("Response Header: {0}, Value: {1}", key, headers.Get(key));
             }
         }
     }
     catch (AmazonS3Exception amazonS3Exception)
     {
         if (amazonS3Exception.ErrorCode != null &&
             (amazonS3Exception.ErrorCode.Equals("InvalidAccessKeyId") ||
              amazonS3Exception.ErrorCode.Equals("InvalidSecurity")))
         {
             Console.WriteLine("Please check the provided AWS Credentials.");
             Console.WriteLine("If you haven't signed up for Amazon S3, please visit http://aws.amazon.com/s3");
         }
         else
         {
             Console.WriteLine("An error occurred with the message '{0}' when deleting an object", amazonS3Exception.Message);
         }
     }
 }
Exemple #5
0
 public override void DeleteExpired(string domain, string path, TimeSpan oldThreshold)
 {
     using (AmazonS3 client = GetClient())
     {
         IEnumerable <S3Object> s3Obj = GetS3Objects(domain, path);
         foreach (S3Object s3Object in s3Obj)
         {
             GetObjectMetadataRequest request =
                 new GetObjectMetadataRequest().WithBucketName(_bucket).WithKey(s3Object.Key);
             using (GetObjectMetadataResponse metadata = client.GetObjectMetadata(request))
             {
                 string privateExpireKey = metadata.Metadata["private-expire"];
                 if (!string.IsNullOrEmpty(privateExpireKey))
                 {
                     long fileTime;
                     if (long.TryParse(privateExpireKey, out fileTime))
                     {
                         if (DateTime.UtcNow > DateTime.FromFileTimeUtc(fileTime))
                         {
                             //Delete it
                             DeleteObjectRequest deleteObjectRequest =
                                 new DeleteObjectRequest().WithBucketName(_bucket).WithKey(s3Object.Key);
                             using (client.DeleteObject(deleteObjectRequest))
                             {
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Exemple #6
0
        public override void MoveDirectory(string srcdomain, string srcdir, string newdomain, string newdir)
        {
            string srckey = MakePath(srcdomain, srcdir);
            string dstkey = MakePath(newdomain, newdir);

            //List files from src
            using (AmazonS3 client = GetClient())
            {
                var request = new ListObjectsRequest {
                    BucketName = _bucket
                };
                request.WithPrefix(srckey);

                using (ListObjectsResponse response = client.ListObjects(request))
                {
                    foreach (S3Object s3Object in response.S3Objects)
                    {
                        client.CopyObject(new CopyObjectRequest()
                                          .WithSourceBucket(_bucket)
                                          .WithSourceKey(s3Object.Key)
                                          .WithDestinationBucket(_bucket)
                                          .WithDestinationKey(s3Object.Key.Replace(srckey, dstkey)).WithCannedACL(
                                              GetDomainACL(newdomain)));
                        client.DeleteObject(new DeleteObjectRequest().WithBucketName(_bucket).WithKey(s3Object.Key));
                    }
                }
            }
        }
        public static S3Response PhysicallyDeletePhoto(AmazonS3 anS3Client, string aBucketName, string aFileName)
        {
            DeleteObjectRequest myDeleteRequest = new DeleteObjectRequest();
            myDeleteRequest.WithBucketName(aBucketName).WithKey(aFileName);

            return anS3Client.DeleteObject(myDeleteRequest);
        }
Exemple #8
0
        public void TestCleanup()
        {
            var deleteRequest = new DeleteObjectRequest()
                                .WithBucketName(bucket.BucketName)
                                .WithKey(this.objKey);

            using (var deleteResponse = client.DeleteObject(deleteRequest)) { }
        }
Exemple #9
0
 public void DeleteFile(string filePath)
 {
     filePath = SanitizePath(filePath);
     AmazonS3.DeleteObject(new DeleteObjectRequest {
         BucketName = BucketName,
         Key        = filePath,
     });
 }
Exemple #10
0
 public static void DeleteFile(AmazonS3 Client, string filekey)
 {
     DeleteObjectRequest request = new DeleteObjectRequest()
     {
         BucketName = BUCKET_NAME,
         Key        = filekey
     };
     S3Response response = Client.DeleteObject(request);
 }
Exemple #11
0
 public static void DeleteFile(AmazonS3 Client, string filekey)
 {
     DeleteObjectRequest request = new DeleteObjectRequest()
     {
         BucketName = BUCKET_NAME,
         Key = filekey
     };
     S3Response response = Client.DeleteObject(request);
 }
Exemple #12
0
        public static void Main(string[] args)
        {
            log4net.Config.XmlConfigurator.Configure();
            log.Info("Initializing and connecting to AWS...");

            s3 = AWSClientFactory.CreateAmazonS3Client(RegionEndpoint.USWest1);
            indexer = new FileIndexer("Files");
            indexer.Index();

            s3indexer = new S3Indexer(Settings.Default.BucketName, Settings.Default.FolderName, "S3Tmp", s3);
            s3indexer.Index();

            log.Info("Comparing local index and remote index.");

            var filesToUpload = (from filePair in indexer.FileIndex where !s3indexer.HashedFiles.ContainsKey(filePair.Key) || !s3indexer.HashedFiles[filePair.Key].SequenceEqual(filePair.Value) select filePair.Key).ToList();
            var filesToDelete = (from filePair in s3indexer.HashedFiles where !indexer.FileIndex.ContainsKey(filePair.Key) select filePair.Key).ToList();

            foreach(var fileDelete in filesToDelete)
            {
                log.Debug("Deleting file "+fileDelete);
                s3.DeleteObject(new DeleteObjectRequest()
                                    {
                                        BucketName = Settings.Default.BucketName,
                                        Key = Settings.Default.FolderName + "/" + fileDelete
                                    });
            }

            foreach(var fileUpload in filesToUpload)
            {
                log.Debug("Uploading file "+fileUpload);
                s3.PutObject(new PutObjectRequest()
                                 {
                                     BucketName = Settings.Default.BucketName,
                                     Key = Settings.Default.FolderName + "/" + fileUpload,
                                     AutoCloseStream = true,
                                     InputStream = new FileStream("Files/" + fileUpload, FileMode.Open)
                                 });
            }

            log.Info("Re-indexing files...");

            using (MemoryStream stream = new MemoryStream())
            {
                Serializer.Serialize(stream, indexer.FileIndex);
                stream.Position = 0;
                s3.PutObject(new PutObjectRequest()
                {
                    BucketName = Settings.Default.BucketName,
                    Key = Settings.Default.FolderName + "/" + "index.mhash",
                    InputStream = stream
                });
            }

            log.Info("Done!");

            Console.Read();
        }
Exemple #13
0
        /// <summary>
        /// Delete an object within a bucket.
        /// The object is identified by its key.
        /// </summary>
        /// <param name="bucketName">The name of the bucket.</param>
        /// <param name="key">The key of the object.</param>
        public void DeleteObject(string bucketName, string key)
        {
            var request = new DeleteObjectRequest
            {
                BucketName = bucketName, Key = key
            };

            _amazonS3.DeleteObject(request);
        }
Exemple #14
0
 protected override void ExecuteS3Task()
 {
     using (AmazonS3 client = Amazon.AWSClientFactory.CreateAmazonS3Client(this.AccessKey, this.SecretAccessKey)) {
         DeleteObjectRequest request = new DeleteObjectRequest {
             BucketName = this.BucketName,
             Key        = this.File
         };
         client.DeleteObject(request);
     }
 }
        public bool Post([FromUri] string token, [FromUri] long objectId, [FromUri] string newName) // Para renombrar un archivo
        {
            var userData   = CheckPermissions(token);
            var fileData   = _readOnlyRepository.GetById <File>(objectId);
            var clientDate = DateTime.Now;

            if (!fileData.IsDirectory)
            {
                //Copy the object
                var copyRequest = new CopyObjectRequest
                {
                    SourceBucket      = userData.BucketName,
                    SourceKey         = fileData.Url + fileData.Name,
                    DestinationBucket = userData.BucketName,
                    DestinationKey    = fileData.Url + newName + "." + (fileData.Name.Split('.').LastOrDefault()),
                    CannedACL         = S3CannedACL.PublicRead
                };

                AWSClient.CopyObject(copyRequest);

                //Delete the original
                var deleteRequest = new DeleteObjectRequest
                {
                    BucketName = userData.BucketName,
                    Key        = fileData.Url + fileData.Name
                };
                AWSClient.DeleteObject(deleteRequest);

                fileData.ModifiedDate = clientDate;
                fileData.Name         = newName + "." + (fileData.Name.Split('.').LastOrDefault());
                _writeOnlyRepository.Update(fileData);
                return(true);
            }
            else
            {
                RenameFolder(objectId, fileData.Name, newName, clientDate.ToString());
                fileData.ModifiedDate = clientDate;
                fileData.Name         = newName;
                _writeOnlyRepository.Update(fileData);
                return(true);
            }
        }
        /// <summary>
        /// Deletes the from S3.
        /// </summary>
        /// <exception cref="T:System.Net.WebException"></exception>
        /// <exception cref="T:Amazon.S3.AmazonS3Exception"></exception>
        public void Delete()
        {
            if (Exists)
            {
                s3Client.DeleteObject(new DeleteObjectRequest()
                                      .WithBucketName(bucket)
                                      .WithKey(S3Helper.EncodeKey(key))
                                      .WithBeforeRequestHandler(S3Helper.FileIORequestEventHandler) as DeleteObjectRequest);

                Directory.Create();
            }
        }
Exemple #17
0
        /// <summary>
        /// Deletes a file
        /// </summary>
        /// <param name="path">Web path to file's folder</param>
        /// <param name="fileName">File name</param>
        public void DeleteFile(string path, string fileName)
        {
            // Prepare delete request
            var request = new DeleteObjectRequest();

            request.WithBucketName(_bucketName)
            .WithKey(GetKey(path, fileName));

            // Delete file
            var response = _client.DeleteObject(request);

            response.Dispose();
        }
        public JsonResult JSONDeleteAWSFile(string key)
        {
            var request = new DeleteObjectRequest();

            request.WithBucketName(AWSBucket)
            .WithKey(key);

            using (AmazonS3 client = Amazon.AWSClientFactory.CreateAmazonS3Client(AWSAccessKey, AWSSecretKey))
            {
                using (DeleteObjectResponse response = client.DeleteObject(request)) { }
            }

            return(Json(null));
        }
Exemple #19
0
        /// <summary>
        /// Deletes the from S3.
        /// </summary>
        /// <exception cref="T:System.Net.WebException"></exception>
        /// <exception cref="T:Amazon.S3.AmazonS3Exception"></exception>
        public void Delete()
        {
            if (Exists)
            {
                var deleteObjectRequest = new DeleteObjectRequest
                {
                    BucketName = bucket,
                    Key        = S3Helper.EncodeKey(key)
                };
                deleteObjectRequest.BeforeRequestEvent += S3Helper.FileIORequestEventHandler;
                s3Client.DeleteObject(deleteObjectRequest);

                Directory.Create();
            }
        }
Exemple #20
0
        public void Delete(string domain, string path, bool quotaDelete)
        {
            using (AmazonS3 client = GetClient())
            {
                string key = MakePath(domain, path);
                if (quotaDelete)
                {
                    QuotaDelete(domain, client, key);
                }

                DeleteObjectRequest request =
                    new DeleteObjectRequest().WithBucketName(_bucket).WithKey(key);
                client.DeleteObject(request);
            }
        }
Exemple #21
0
        public string DeleteFile(string sFolder, string sObjectKey)
        {
            AmazonS3 client      = AWSClientFactory.CreateAmazonS3Client(S3ACCESSKEY, S3SECRETKEY);
            string   BUCKET_NAME = ConfigurationManager.AppSettings["AWSBUCKET"];

            if (sFolder != "")
            {
                sObjectKey = sFolder + "/" + sObjectKey;
            }

            DeleteObjectRequest deleteRequest = new Amazon.S3.Model.DeleteObjectRequest();

            deleteRequest.WithBucketName(BUCKET_NAME);
            deleteRequest.WithKey(sObjectKey);
            DeleteObjectResponse response = client.DeleteObject(deleteRequest);

            return(response.ResponseXml);
        }
Exemple #22
0
        public void Delete(string domain, string path, bool quotaDelete)
        {
            using (AmazonS3 client = GetClient())
            {
                string key = MakePath(domain, path);
                if (quotaDelete)
                {
                    QuotaDelete(domain, client, key);
                }

                var request = new DeleteObjectRequest
                {
                    BucketName = _bucket,
                    Key        = key
                };

                client.DeleteObject(request);
            }
        }
        public void Delete(string fileName)
        {
            string uniqueKeyItemName = string.Format("{0}-{1}", keyName, fileName);
            DeleteObjectRequest deleteObjectRequest =
             new DeleteObjectRequest()
             .WithBucketName(bucketName)
             .WithKey(uniqueKeyItemName );

            using (client = new AmazonS3Client(accessKeyID, secretAccessKeyID))
            {
                try
                {
                    client.DeleteObject(deleteObjectRequest);
                }
                catch (AmazonS3Exception s3Exception)
                {
                    throw new Exception( String.Format("Error Occurred in Delete operation for ObjectKeyID: {0}", uniqueKeyItemName ),s3Exception);
                }
            }
        }
        public void delete_file(string folderName, string fileName)
        {
            // It's allowed to have an empty folder name.
            // if (String.IsNullOrWhiteSpace(folderName)) throw new ArgumentNullException("folderName");
            if (String.IsNullOrWhiteSpace(fileName))
            {
                throw new ArgumentNullException("fileName");
            }

            folderName = (string.IsNullOrEmpty(folderName) ? String.Empty : folderName.Substring(folderName.Length - 1, 1) == "/" ? folderName : folderName + "/");
            fileName   = string.Format("{0}{1}", folderName, fileName);

            var request = new DeleteObjectRequest();

            request.WithBucketName(clientContext.BucketName);
            request.WithKey(fileName);

            using (AmazonS3 client = clientContext.create_instance())
            {
                S3Response response = wrap_request_in_error_handler(() => client.DeleteObject(request));
            }
        }
Exemple #25
0
        public void DeleteFile(string folderName, string fileName)
        {
            //folder ignored - packages stored on top level of S3 bucket
            if (String.IsNullOrWhiteSpace(folderName))
            {
                throw new ArgumentNullException("folderName");
            }
            if (String.IsNullOrWhiteSpace(fileName))
            {
                throw new ArgumentNullException("fileName");
            }

            var request = new DeleteObjectRequest();

            request.WithBucketName(clientContext.BucketName);
            request.WithKey(fileName);

            using (AmazonS3 client = clientContext.CreateInstance())
            {
                S3Response response = WrapRequestInErrorHandler(() => client.DeleteObject(request));
            }
        }
Exemple #26
0
        public override void MoveDirectory(string srcdomain, string srcdir, string newdomain, string newdir)
        {
            string srckey = MakePath(srcdomain, srcdir);
            string dstkey = MakePath(newdomain, newdir);

            //List files from src
            using (AmazonS3 client = GetClient())
            {
                var request = new ListObjectsRequest
                {
                    BucketName = _bucket,
                    Prefix     = srckey
                };

                using (var response = client.ListObjects(request))
                {
                    foreach (S3Object s3Object in response.S3Objects)
                    {
                        client.CopyObject(new CopyObjectRequest
                        {
                            SourceBucket               = _bucket,
                            SourceKey                  = s3Object.Key,
                            DestinationBucket          = _bucket,
                            DestinationKey             = s3Object.Key.Replace(srckey, dstkey),
                            CannedACL                  = GetDomainACL(newdomain),
                            ServerSideEncryptionMethod = ServerSideEncryptionMethod.AES256
                        });

                        client.DeleteObject(new DeleteObjectRequest
                        {
                            BucketName = _bucket,
                            Key        = s3Object.Key
                        });
                    }
                }
            }
        }
Exemple #27
0
        public override void DeleteFiles(string domain, string path, string pattern, bool recursive)
        {
            IEnumerable <S3Object> s3Obj    = GetS3Objects(domain, path);
            IEnumerable <S3Object> objToDel =
                s3Obj.Where(x => Wildcard.IsMatch(pattern, Path.GetFileName(x.Key))).Select(x => x);

            using (AmazonS3 client = GetClient())
            {
                foreach (S3Object s3Object in objToDel)
                {
                    if (QuotaController != null)
                    {
                        QuotaController.QuotaUsedDelete(_modulename, domain, _dataList.GetData(domain),
                                                        Convert.ToInt64(s3Object.Size));
                    }
                    //Delete
                    DeleteObjectRequest deleteRequest =
                        new DeleteObjectRequest().WithBucketName(_bucket).WithKey(s3Object.Key);
                    using (client.DeleteObject(deleteRequest))
                    {
                    }
                }
            }
        }
Exemple #28
0
 private static void DeleteObject(AmazonS3 s3Client, string bucket, string key)
 {
     var deleteObjectRequest = new DeleteObjectRequest().WithBucketName(bucket).WithKey(key);
       s3Client.DeleteObject(deleteObjectRequest);
 }
    public static int deleteImgFromCloud(string sqlVar)
    {
        /*
         * Function : Delete Image (Profile and Gallery from Cloud)
         *          : 1. Get File ext of the file to be deleted
         *          : 2. Nullify the Image Path and Caption
         *          : 3. Delete the Image from the server.
         *
         */
        string fileName;
        string connStr = WebConfigurationManager.ConnectionStrings["eastManDB"].ConnectionString;

        try
        {
            string sqlStr = "SELECT " + sqlVar + "Path," + sqlVar + "PathThumbNail," +
                            sqlVar + "Pathgallery " +
                            "FROM bizPicDtls WHERE ID = '" + Membership.GetUser().ProviderUserKey.ToString() + "'";

            //System.Windows.Forms.MessageBox.Show(sqlStr);

            using (SqlConnection connection = new SqlConnection(connStr))
            {
                SqlCommand command = new SqlCommand(sqlStr, connection);
                connection.Open();
                SqlDataReader reader = command.ExecuteReader();
                if (reader.HasRows)
                {
                    reader.Read();
                    if (!reader.IsDBNull(0))
                    {
                        fileName = reader.GetString(0).Substring(reader.GetString(0).LastIndexOf("."), (reader.GetString(0).Length - reader.GetString(0).LastIndexOf(".")));
                        fileName = sqlVar + fileName;
                        string uploadFileName = @"Images/orginal/"
                                                + Membership.GetUser().ProviderUserKey.ToString()
                                                + @"/" + fileName;
                        uploadFileName = reader.GetString(0);
                        connection.Close();
                        string storedProc = "bizPicDtls_Update_" + sqlVar;

                        SqlConnection con = new SqlConnection(connStr);
                        SqlCommand    cmd = new SqlCommand(storedProc, con);
                        cmd.CommandType = CommandType.StoredProcedure;

                        cmd.Parameters.Add(new SqlParameter("@imgPath", SqlDbType.VarChar, 1000));
                        cmd.Parameters.Add(new SqlParameter("@imgCaption", SqlDbType.VarChar, 100));
                        cmd.Parameters.Add(new SqlParameter("@imgID", SqlDbType.VarChar, 50));
                        cmd.Parameters.Add(new SqlParameter("@imgThumbNailPath", SqlDbType.VarChar, 1000));
                        cmd.Parameters.Add(new SqlParameter("@imggalleryPath", SqlDbType.VarChar, 1000));

                        if (sqlVar == "profileImg")
                        {
                            cmd.Parameters.Add(new SqlParameter("@IsABiz", SqlDbType.Bit));
                            if (HttpContext.Current.User.IsInRole("bizOwner"))
                            {
                                cmd.Parameters["@IsABiz"].Value = 1;
                            }
                            else
                            {
                                cmd.Parameters["@IsABiz"].Value = 0;
                            }
                        }


                        cmd.Parameters["@imgPath"].Value          = DBNull.Value;
                        cmd.Parameters["@imgThumbNailPath"].Value = DBNull.Value;
                        cmd.Parameters["@imggalleryPath"].Value   = DBNull.Value;
                        cmd.Parameters["@imgCaption"].Value       = DBNull.Value;
                        cmd.Parameters["@imgID"].Value            = Membership.GetUser().ProviderUserKey.ToString();


                        try
                        {
                            con.Open();
                            cmd.ExecuteNonQuery();
                        }
                        catch (SqlException)
                        {
                            return(12);
                        }
                        finally
                        {
                            con.Close();
                        }


                        /* If Stored Procedure execution sucessfull then delete file from
                         * Amazon S3
                         **/

                        AmazonS3 myS3   = new AmazonS3();
                        DateTime myTime = DateTime.Now;
                        try
                        {
                            string strMySignature = S3Helper.GetSignature(
                                mySecretAccessKeyId,
                                "DeleteObject",
                                myTime);

                            Status myResults = myS3.DeleteObject(
                                awsDirName,
                                uploadFileName,
                                myAWSAccessKeyId,
                                S3Helper.GetTimeStamp(myTime),
                                true,
                                strMySignature,
                                null);
                            if (myResults.Code == 0 || myResults.Code == 204)
                            {
                                //System.Windows.Forms.MessageBox.Show(myResults.Code.ToString());
                                return(0);
                            }
                            else
                            {
                                //System.Windows.Forms.MessageBox.Show(myResults.Code.ToString());
                                return(9);
                            }
                        }
                        catch (Exception)
                        {
                            return(8);
                        }
                        finally
                        {
                            connection.Close();
                        }
                    }
                    else
                    {
                        return(2);
                    }
                }
                else
                {
                    return(4);
                }
            }
        }
        catch (SqlException)
        {
            //System.Windows.Forms.MessageBox.Show(ex.Message );
            return(3);
        }
    }
        private void deleteFile(bool hasFile, string fileType, int id)
        {
            if (hasFile)
            {
                DeleteObjectRequest request = new DeleteObjectRequest();
                request.WithBucketName("intelrecruiter");

                ListObjectsRequest listObjReq = new ListObjectsRequest();
                listObjReq.WithBucketName("intelrecruiter")
                    .WithPrefix(fileType + "/" + id.ToString());
                using (client = Amazon.AWSClientFactory.CreateAmazonS3Client("AKIAJ47VSG7WMA62WLCA", "3tqlHujlftpk6j/z5OtDw2eg9N2FJtz1RwL8bEa3"))
                {
                    var results = client.ListObjects(listObjReq).S3Objects;
                    foreach (var obj in results)
                    {
                        request.Key = obj.Key;
                        client.DeleteObject(request);
                    }
                }
            }
        }
Exemple #31
0
        private static void DeleteObject(AmazonS3 s3Client, string bucket, string key)
        {
            var deleteObjectRequest = new DeleteObjectRequest().WithBucketName(bucket).WithKey(key);

            s3Client.DeleteObject(deleteObjectRequest);
        }