472,110 Members | 2,142 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,110 software developers and data experts.

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,username 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
Sep 29 '08 #1
1 1386
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:
Expand|Select|Wrap|Line Numbers
  1.    Private Sub GetFCCDataFile()
  2.       Dim CurrentDirectory As String = Application.StartupPath() + "\"
  3.       Dim DestinationDirectory As String = CurrentDirectory + "DataFiles\"
  4.       Dim FileName As String = "l_amat.zip"
  5.       Dim remoteUri As String = "http://wireless.fcc.gov/uls/data/complete/"
  6.       Dim Downloadfile As String = remoteUri + FileName
  7.       Dim myWebClient As New System.Net.WebClient()
  8.  
  9.       Try
  10.          ' Determine whether the directory already exists.
  11.          If System.IO.Directory.Exists(DestinationDirectory) = True Then
  12.             ' Delete the target to ensure it is not there.
  13.             ' You don't need the following, so commented out
  14.             'System.IO.Directory.Delete(DestinationDirectory, True)
  15.          End If
  16.          ' Create the directory.
  17.          ' You may want the next item as it creates the download directory
  18.          ' System.IO.Directory.CreateDirectory(DestinationDirectory)
  19.          ' Move to data directory
  20.          System.IO.Directory.SetCurrentDirectory(DestinationDirectory)
  21.          ' Download the file
  22.          myWebClient.DownloadFile(Downloadfile, FileName)
  23.          ' Restore original directory
  24.          System.IO.Directory.SetCurrentDirectory(CurrentDirectory)
  25.       Catch ex As Exception
  26.          Console.WriteLine("Unable to download file: {0}", ex.ToString())
  27.       End Try
  28.    End Sub
  29.  
Hope this helps.
Oct 1 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Nathan Sokalski | last post: by
3 posts views Thread by OriginalBrownster | last post: by
Chittaranjan
reply views Thread by Chittaranjan | last post: by
ganesanji
3 posts views Thread by ganesanji | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.