I am trying to save an image from the client side to a folder using vb.net
“” the image that has the myImage ID “”
<asp:Image runat="server" ID="myImage" ImageUrl="http://www.govcomm.harris.com/images/1F-81-imageLinks650a.jpg" />
<asp:Image runat="server" ID="myImage2" ImageUrl="http://www.govcomm.harris.com/images/2F-81-imageLinks650b.jpg" />
this is just the location where i want to save my image :
i haven’t run or try any thing with this code , i am just wondering how to do this
this location is on the server side
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim saveLocation As String = Server.MapPath("PDFs")
End Sub
Also, I would like to know if there is a way to use the id to save since i might have more than one image to be saved.
If you want to upload a file from the client side (from the user via browser) to the server folder, you need to user the FileUpload control
And in your Codebehind, you can save that to a location by Calling the
PostedFile.SaveAsmethodEDIT : As per the comment
If you want to download a file from the internet, you can do it with the WebClient classes DownloadFile method. Here is an example.