Uploading and downloading from ftp through vb coding

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gracepaul
    New Member
    • Jul 2008
    • 28

    Uploading and downloading from ftp through vb coding

    hi all,

    I want to upload and dowmload an access database whose size is very large in ftp through vb coding. I am giving the server address,usernam e and password to connect with ftp. Then by pressing a buton the database in a particular path in my system will be uploaded to the specified path in ftp. This worked well. But when the size of database became large this process won't work well and it gives me an error like this.

    Error 12003200 Type Set to 1

    I am using vb coding

    If anyone have an idea please share it as early as possible.

    Thanks and regards

    Grace
  • Flugeldorph
    New Member
    • Oct 2008
    • 11

    #2
    Hello Grace. I am new to VB, but just finished a routine that does an ftp of a file from the FCC server. It works. Here's the code that I used:
    Code:
       Private Sub GetFCCDataFile()
          Dim CurrentDirectory As String = Application.StartupPath() + "\"
          Dim DestinationDirectory As String = CurrentDirectory + "DataFiles\"
          Dim FileName As String = "l_amat.zip"
          Dim remoteUri As String = "http://wireless.fcc.gov/uls/data/complete/"
          Dim Downloadfile As String = remoteUri + FileName
          Dim myWebClient As New System.Net.WebClient()
    
          Try
             ' Determine whether the directory already exists.
             If System.IO.Directory.Exists(DestinationDirectory) = True Then
                ' Delete the target to ensure it is not there.
                ' You don't need the following, so commented out
                'System.IO.Directory.Delete(DestinationDirectory, True)
             End If
             ' Create the directory.
             ' You may want the next item as it creates the download directory
             ' System.IO.Directory.CreateDirectory(DestinationDirectory)
             ' Move to data directory
             System.IO.Directory.SetCurrentDirectory(DestinationDirectory)
             ' Download the file
             myWebClient.DownloadFile(Downloadfile, FileName)
             ' Restore original directory
             System.IO.Directory.SetCurrentDirectory(CurrentDirectory)
          Catch ex As Exception
             Console.WriteLine("Unable to download file: {0}", ex.ToString())
          End Try
       End Sub
    Hope this helps.

    Comment

    Working...