We are testing the Rebex component. Specifically we are testing the FTP SSL for .NET 2.0 Trial component. The code in C# is as follows

   //Create Rebex FTP Component    
   Ftp rebexFTP = new Ftp();    
   rebexFTP.Connect(strURL,  20021, null, FtpSecurity.Explicit);    
   rebexFTP.Login(strUser strPass);    
   rebexFTP.ChangeDirectory(FTPHomeDirectory);    
   rebexFTP.ChangeDirectory(FTPUploadDirectory);    
   numBytes = rebexFTP.PutFile(strFileName);

The good news is that this code works – we are able to Connect using the port, Login, Change Directories and Upload the file. The only problem is that this file is sent in binary format and needs to be sent in ASCII format. Is there a way to tell the Rebex component to upload the file in ASCII on the PutFile method?

When we test using a FTP client Core FTP we are able to upload the file in ASCII format using the same Login, port directories etc.

asked 07 Jan '11, 16:13

Bruce's gravatar image

Bruce
16
accept rate: 0%

edited 07 Jan '11, 16:42

Rebex%20KB's gravatar image

Rebex KB ♦♦
258519


The Ftp class default transfer mode is binary. To upload file in ASCII format try setting the TransferType property to FtpTransferType.Ascii first.

//Create Rebex FTP Component    
Ftp rebexFTP = new Ftp();    
rebexFTP.Connect(strURL,  20021, null, FtpSecurity.Explicit);    
rebexFTP.Login(strUser strPass);    
rebexFTP.ChangeDirectory(FTPHomeDirectory);    
rebexFTP.ChangeDirectory(FTPUploadDirectory); 

// change transfer mode to ASCII and upload the file
rebexFTP.TransferType = FtpTransferType.Ascii;
numBytes = rebexFTP.PutFile(strFileName);
link

answered 07 Jan '11, 16:45

Martin%20Vobr's gravatar image

Martin Vobr ♦♦
335310
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×152
×2

Asked: 07 Jan '11, 16:13

Seen: 578 times

Last updated: 01 Apr '11, 19:22