开发者

Get image from external server

开发者 https://www.devze.com 2023-01-20 07:46 出处:网络
We are storing our images at Amazon S3. Let\'s say the location is http://media.sitename.com/folder1/image1.jpg.

We are storing our images at Amazon S3. Let's say the location is http://media.sitename.com/folder1/image1.jpg.

I want to copy this file and store it in our server. Is it possible to do this using C#. I am using asp.net 4.0.

Please 开发者_开发知识库help. Thanks.


Here you go:

using (var client = new WebClient()) 
{ 
    client.DownloadFile(imageURL, localPathname);
}

where imageURL is http://media.sitename.com/folder1/image1.jpg and localPathname is something like C:\my\images\directory\cachedImage.jpg


Download Image using c#

Download image from Web

Just Google/Bing "Download Image from server using c#" and you will get many more links.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号