我试图将我商店中的视频文件从一个文件夹复制到另一个文件夹。这些文件都低于1GB。我每次尝试都会遇到异常。
S3商店的名称:BandMedia
示例文件:
SourceFileName:VideoFiles / Band1 / video1_38372836.mp4
DestinationFileName:VideoFiles / Band2 / video1_47296110.mp4
文件夹" VideoFiles"存在于我的AWS S3商店中。
但是,DestinationFileName的波段名称是新的(Band2)。
所以也许它不会因此而复制?我是否需要先为乐队创建文件夹,然后进行复制?但我非常确定我在SDK文档中读到,如果该文件夹不存在,它将自动创建。
以下是从AWS SDK示例中复制的代码:
Try
Dim AppSettings As Specialized.NameValueCollection = System.Configuration.ConfigurationManager.AppSettings()
Dim AwsAccessKey As String = "xxxxxx"
Dim AwsSecretKey As String = "11111"
Dim AwsBucketName = "BandMedia"
Dim AwsRegionEndpoint As String = AwsEndPoint
Dim AwsRegionEndpointObj As RegionEndpoint = RegionEndpoint.GetBySystemName(AwsRegionEndpoint)
Dim s3 = New Amazon.S3.AmazonS3Client(AwsAccessKey, AwsSecretKey, AwsRegionEndpointObj)
Dim cRequest As CopyObjectRequest
Dim cReponse As CopyObjectResponse
cRequest = New CopyObjectRequest()
With cRequest
.SourceBucket = AwsBucketName
.DestinationBucket = AwsBucketName
.SourceKey = SourceFileName
.DestinationKey = DestinationFileName
.CannedACL = S3CannedACL.PublicRead
End With
cReponse = s3.CopyObject(cRequest)
Return cReponse.HttpStatusCode = 200
Catch ex As AmazonS3Exception
Return False
End Try
这是错误:
抛出异常:' System.Exception'在videoMusicApp.dll异常中 同时将文件VideoFiles / Band1 / video1_38372836.mp4复制到 VideoFiles /波段2 / video1_47296110.mp4
另一个想法......也许是因为它在同一家商店?
老实说,我不知道。
有人可以帮帮我吗?谢谢!