我正在尝试使用我的数据库中的url并将图像下载到AWS s3。 我正在挠头,因为我不知道该怎么做。
我试图通过Windows服务
来做到这一点我尝试过以下方法:
Sub Images()
Dim ds_data As DataSet
Try
ds_data = SqlHelper.ExecuteDataset(Configuration.ConfigurationSettings.AppSettings.Item("ConnectionString"), CommandType.StoredProcedure, "ETSP_GET_PHOTO_URLS")
For Each dr As DataRow In ds_data.Tables(0).Rows
Dim ImageURL = dr("column_URL")
Dim Client As New WebClient
Client.DownloadFile("ImageURL", "FileName")
Client.Dispose()
s3.UploadFile("me", "Test", "ImageURL", True, "me.s3-website-eu-west-1.amazonaws.com", "Ireland", 0)
Next
Catch ex As Exception
End Try
End Sub
ETSP_GET_PHOTO_URLS带回网址:http://img.website.net/p/1483/278227_20094171232290.jpg
s3.UploadFile
期望值如下:BucketName, FolderName, FileName, makePublic, UploadDirectory, region, cacheTime
我对此很新。任何帮助,将不胜感激。我不介意C#或VB的帮助。