I'm trying to save an image from another web site to my server. First I was using a fileupload and then using the postedfile.saveas function to save the image from the users machine to the server and then add a reference to the database However I'm now using the manual add function with the Amazon eCommerce function. But the problem I'm having is how do I take an image from a web site (in this case Amazon) and save it on a server? I can get the URL for the image but can't see anyway to take that URL and use it to save a copy of the file to a specified location on my server. I've tried looking at the File, Image and Object objects but I can't see a solution. Any helps appreciated
it's not necessarily the image, it can be any image on the web, the image isn't important it's how do you save an image from the web to your server? Also this is ASP.Net
Create a WebClient object, then use it's DownloadFile method Dim WebObj as New WebClient() Dim RemoteFileLocation As String = "http://www.google.com/intl/en_ALL/images/logo.gif" Dim LocalFileLocation As String = "C:\logo.gif" Dim myWebClient As New WebClient() WebObj.DownloadFile(RemoteFileLocation, LocalFileLocation) This should do the trick me thinks