473,378 Members | 1,152 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 1471
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

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

Similar topics

0
by: TJ | last post by:
Hi, I've written code web-based uploading and downloading. Here is some code for it. For saving file into MS-SQL database, SaveFileIntoDB(HttpPostedFile file) { int fileLength =...
4
by: Himanshu | last post by:
hi, Can anybody tell me that thru asp.net using c#, how can we upload and download physical files in any table of SQL Server Database. the uploading part is running successfully but the...
5
by: Nathan Sokalski | last post by:
I am trying to write code to allow my users to upload a file. The code I am using is as follows: Dim upfilename As String = "" If fileDetails.Value <> "" AndAlso...
1
by: mubarak basha | last post by:
hi, i need the coding for downloading pdf files..........please sugggest how to write the coding or give some sample coding... regards, mubarak.
3
by: OriginalBrownster | last post by:
I am currently uploading a file from a users computer to the file system on my server using python, just reading the file and writing the binaries. total_data=' ' while True: data =...
0
Chittaranjan
by: Chittaranjan | last post by:
Hi All, I am farely new to the perl coding. So as I am doing a project, in that I have a form which have an uploading option that means let me make you all clear that firts we need to fill...
0
by: mivey4 | last post by:
I have been experimenting with sending and receiving files using the webClient class provided in .NET. (C#) I don't seem to have any problems downloading files from my test web server using the...
3
ganesanji
by: ganesanji | last post by:
hi all, I have written a php coding for uploading a file to a specific folder or location in server which is a Linux server. I think the coding for file uploaing is correct. But it does not...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.