| Dart Home | PowerTCP FTP for .NET | Custom Development | Reply | PowerTCP FTP for .NET Topics | Forums |
| Author | Forum: PowerTCP FTP for .NET Topic: Binary file changes size on download |
| msisson msisson@firstam.com From: poway, CA USA Posts: 22 Member Since: 09/24/03 |
posted October 30, 2003 5:46 PM I'm retrieving a binary file from an FTP site and it seems to grow when it's downloaded. Here's my C# code: ftp = new Dart.PowerTCP.Ftp.Ftp(); ftp.ServerPort = 21; ftp.Server = txtServer.Text; ftp.Username = txtUsername.Text; ftp.Password = txtPassword.Text; ftp.DoEvents = false; ftp.Passive = false; ftp.Restart = false; ftp.Timeout = 30000; //30 second timeout Dart.PowerTCP.Ftp.Listing myList = ftp.List(txtRemotePath.Text + txtFileName.Text, true); Dart.PowerTCP.Ftp.ListEntry le; if (myList.Count == 1) { le = myList[0]; filesize = le.Size; } DartFiles = ftp.Get(txtRemotePath.Text, txtFileName.Text, txtLocalPath.Text, false); Later in the code I compare the filesize var to the file size of the actually file downloaded. The original file size was 14176 and the downloaded filesize is 14219. Is there a setting for the component that I need to set? This is a binary encrypted file. Thanks mark |
| msisson msisson@firstam.com From: poway, CA USA Posts: 22 Member Since: 09/24/03 |
posted October 30, 2003 5:48 PM typo... the original filesize on the FTP server was 14176 but it's size on my local hard drive after downloading was 14219. TIA |
| msisson msisson@firstam.com From: poway, CA USA Posts: 22 Member Since: 09/24/03 |
posted October 30, 2003 5:52 PM Ok, I added this property to the mix and it seemed to work: ftp.FileType = Dart.PowerTCP.Ftp.FileType.Image; Does Image mean binary? This certainly isn't an FTP standard is it? And can I change the FileType prior to each retrieval so that I can retrieve binary files and text files during the same session?? thanks |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 30, 2003 7:06 PM Yes. Yes. And Yes. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 30, 2003 11:28 PM The second yes needs more explanation. When you set binary mode on an FTP server the command is "MODE I" where the "I" is for image. That's why we chose that name for the constant. |
| msisson msisson@firstam.com From: poway, CA USA Posts: 22 Member Since: 09/24/03 |
posted October 31, 2003 11:01 AM Thanks for the explanation Tony. |
| Reply | PowerTCP FTP for .NET Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|