Upload a file to a file to a website in Visual Basic .NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

This is a code sample to upload a file or an image to a website or a server in visual basic .net
To upload a file to a website add the following code:
My.Computer.Network.UploadFile("C:\location\file.xxx", _
 "ftp://domain.com/www/file.xxx", _
  "username", "password", True, 500)
Change the first part to your local file destination.
Change the second part to the destination on the server where you want to upload the file.
The third and the fourth part are the username and the password to the server. Usually that is the same as your ftp credentials.
The fifth part is either True or False. Set True to display the progress dialog and False to hide it.
The last part is the time in milliseconds to connection timeout. (In case of no internet connection)


Share This

Home | About | Contact | Privacy Policy

Copyright visual-basic-tutorials.com 2017 - All Rights Reserved.