| Dart Home | PowerTCP FTP for .NET | Custom Development | Reply | PowerTCP FTP for .NET Topics | Forums |
| Author | Forum: PowerTCP FTP for .NET Topic: VB .NET 2005 FTP and laptops. |
| DJacobs From: Mandeville, LA USA Posts: 11 Member Since: 06/20/07 |
posted March 10, 2008 11:26 AM I recently purchased the Universal suite but I use Visual basic 2005 as my primary development platform. The question I have is rather simple (I think) but I can't seem to find one in the forums. I have developed an application using another SDK that produces files that need to be transfered via FTP to a home office. The problem I'm having is this. This application runs on laptops where the user can close the laptop up during the middle of a transfer. what I would like to do is capture the shutdown event and suspend the upload and upon restart of the laptop I would like to resume to same transmission from where it left off. also I would like to verify the file that I sent. when the file is sucessfully sent I would like to execute a validation routine on the server end to ensure the file was not corrupted in some way during transit. Could you please show me some kind of example code to get me started (the source files may be either a file or a stream) Thanks in advance Caveman It's hard to live on a dirt road off the information super highway! |
| Arjun From: Rome, NY, USA Posts: 137 Member Since: 09/17/07 |
posted March 10, 2008 3:36 PM Hello Caveman I would suggest you to please use the AbortTransfer method to abort the current file transfer operation. Thereafter, if you wish to resume this incomplete file transfer, just set the Restart property to true. However, if the server does not support restarts, this value will be ignored and the entire file will be transferred. To Abort the transfer, use the code below: Ftp1.AbortTransfer() The following is the code showing the usage of the Restart property: Ftp1.Server = "MyFTPServer" Ftp1.Username = "blah" Ftp1.Password = "mypass" ' Storing a binary file Ftp1.FileType = Dart.PowerTCP.Ftp.FileType.Image ' Specify a restart Ftp1.Restart = true ' Put returns an FtpFile object Dart.PowerTCP.Ftp.FtpFile File ' Put the file, if it partially exists on the server AND the server ' supports restarts, it will automatically be restarted File = Ftp1.Put("C:\Test\Test.bmp", "Test.Bmp") ' Display. If the file transfer was restarted Length will not Equal count. If the ' file transfer was restarted, Length and Count will be equal Debug.WriteLine("Length of the file: " + File.Length) Debug.WriteLine("Bytes transferred: " + File.Count) ' Close the connection Ftp1.Close() The basic objective of FTP control is to upload/download files. Unfortunately, FTP control is not capable of detecting the system shutdown. To check for the validity of the tran |
| Arjun From: Rome, NY, USA Posts: 137 Member Since: 09/17/07 |
posted March 14, 2008 9:22 AM It seems that the reply was cut off. Here is the remaining response: The basic objective of FTP control is to upload/download files. Unfortunately, FTP control is not capable of detecting the system shutdown. To check for the validity of the transferred file, use FileIO object. Regards, Arjun |
| Reply | PowerTCP FTP for .NET Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|