Last post Jun 03, 2011 07:58 AM by Farzan mc
Jun 03, 2011 04:57 AM|Farzan mc|LINK
I always use fileupload control to upload files in my site. Now I want to create an application to upload files via url, like wordpress image upload.
For example there is an image in www.sampledomain.com/image.jpg , I want to type this url in a textbox and upload the file to my server.
What should I do ?
Jun 03, 2011 05:09 AM|qwe123kids|LINK
Jun 03, 2011 07:58 AM|Farzan mc|LINK
Thanks, that was exactly what I wanted.
You have to first import system.net class , then :
Dim remoteUri As String = "http://ia.media-imdb.com/images/M/"
Dim fileName As String = "MV5BMTg4MTQ3NTI3Nl5BMl5BanBnXkFtZTcwNzEzODQ2NA@@._V1._SY317_.jpg"
Dim myStringWebResource As String = Nothing
Dim myWebClient As New WebClient()
myStringWebResource = remoteUri + fileName
myWebClient.DownloadFile(myStringWebResource, "c:\" & fileName)