473,728 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Uploading and downloading from ftp through vb coding

28 New Member
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
Sep 29 '08 #1
1 1493
Flugeldorph
11 New Member
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
1519
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 = file.ContentLength; byte fileContent = new byte; int lastPos = file.FileName.LastIndexOf('\\');
4
2153
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 problem arises in the retriving part of the code. i am not getting that how will i able to download the file which is there in the SQL Server database in the field type "image".
5
4687
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 fileDetails.PostedFile.ContentLength > 0 Then Dim dir As String() = fileDetails.PostedFile.FileName.Split("\".ToCharArray())
1
1548
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
1632
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 = upload_file.file.read(8192) if not data: break total_data += data
0
1179
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 the required fields in the form and then ddownload it so after downloading we need to again upload that by which that will show us the form accordingly filling the form. So I am able to download but when I am trying to upload that form then it is...
0
1221
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 class but sending (uploading) files to the server doesn't seem to be working and I don't receive any errors to suggest there is a problem. WebClient wc = new WebClient(); byte results; string uri =...
3
1913
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 work properly. That means the file is not uploaded to the specified location. It always executes the "else" condition in my coding. I think the problem is lieing in the specifed path which is the target path for file uploading. I could not find out...
221
367582
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 needs to store entire files, the preferred method is to save the file onto the server’s file-system, and store the physical location of the file in your database. This is generally considered to be the easiest and fastest way to store files. ...
0
8753
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9265
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9188
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9122
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6012
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4522
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4787
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3230
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.