Login  
Search All Forums
Dart Home | PowerTCP FTP for .NET | Custom Development Reply | PowerTCP FTP for .NET Topics | Forums   
AuthorForum: PowerTCP FTP for .NET
Topic: FTP ASCIIExtensions Not Working
SGCornerStone

From: Troy, NY USA
Posts: 6
Member Since: 10/31/12
posted October 31, 2012 10:49 AM

We recently had to re-purchase the Dart FTP control after our current server crashed. We previously were using version 4.4.2.3 and are now using 4.5.2.1.

Since upgrading, we can no longer download ASCII files off of a mainframe FTP server similar to the description found in this thread:

http://support.dart.com/postings?topicid=8386#34759

The code calling the Dart.FTP has remained the same...we are doing the SetType to ASCII and setting the ASCIIExtensions.Enabled to false and doing this all over a single connection. However, the files are still coming down in EBCDIC and thus unusable after downloaded.
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted October 31, 2012 11:13 AM

Hello,

Can you please send in a log of downloading a file, as described in your referenced thread? (you may want to replace the username and password in the log)

The one thing that could be affecting this is that we did add support for the EBCDIC file type in version 4.5: http://www.dart.com/ptftpnet_relhist.aspx, but if you're using SetType ASCII, that shouldn't have changed.
SGCornerStone

From: Troy, NY USA
Posts: 6
Member Since: 10/31/12
posted October 31, 2012 11:22 AM

It starts to get a little complicated when you're talking the log. I will update the code to capture a log, but the FTP server we are downloading from is a bit of a pain. It's a Verizon server and once we download a file once, we are unable to download it again without having them reset it. I manually downloaded some files this morning so I'll send over the request for them to re-post one of those so I can test with it.

I will post the log as soon as I can. In the meantime, here is the relevant code snippet that establishes the FTP connection we are using:

      Dim objFTP As New Ftp
      Dim objFTPSession As New FtpSession()
      objFTPSession.RemoteEndPoint.HostNameOrAddress = "****"
      objFTPSession.RemoteEndPoint.Port = 5555
      objFTPSession.Username = "****"
      objFTPSession.Password = "****"
      objFTPSession.Security.EncryptControl = EncryptControl.Explicit
      objFTPSession.Security.EncryptData = True
      objFTPSession.Security.ValidationCallback = AddressOf remoteCertificateValidation
      objFTPSession.ConnectType = DataConnectType.SecurePassive
      objFTPSession.AsciiExtensions.Enabled = False
      objFTP.Session = objFTPSession
      objFTP.Connect()
      objFTP.Authenticate()
      objFTP.Send("PBSZ 0")
      objFTP.Send("PROT P")
      objFTP.Send("PWD")
      objFTP.Send("TYPE A")
      objFTP.Send("PASV")
      objFTP.SetType(FileType.Ascii)

objFTP.Get(objFile.Text, "****", Synchronize.Off)
SGCornerStone

From: Troy, NY USA
Posts: 6
Member Since: 10/31/12
posted October 31, 2012 11:38 AM

As I am waiting for Verizon to report a file, here is the log output from establishing the FTP connection, setting the flags and then closing it. Not sure if this helps in the meantime, but I figured I would post just in case it does. I'll post the full log of retrieving a file as soon as they put something out there for me to retrieve.

<220 CONNECT:Enterprise Gateway 2.1.00. FTP Server ready...
>AUTH TLS-P
<234 AUTH: command accepted. Securing command channel ...
>PBSZ 0
<200 PBSZ command accepted.
>PROT P
<200 PROT command accepted. Data transactions will be secured.
>USER ******
<331 Password required for ******.
>PASS ******
<230 User ***** logged in. Session Id: 29168.
>PBSZ 0
<200 PBSZ command accepted.
>PROT P
<200 PROT command accepted. Data transactions will be secured.
>PWD
<257 "***** " is the current working Mailbox ID.
>TYPE A
<200 TYPE set to A.
>PASV
<227 PASV Entering passive mode (192,76,85,180,217,158).
>TYPE A
<200 TYPE set to A.
>QUIT
<221 Goodbye.
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted October 31, 2012 11:45 AM

Hello,

Just a note, "objFTP.Send("TYPE A")" and "objFTP.SetType(FileType.Ascii)" both send the "TYPE A" command to the server, but there's no obvious reason that that would cause this (the latter sets an internal variable too, though). Additionally, sending the PASV command should similarly be unnecessary, as we will be sending that to the server automatically as well.

I really just need to see the log to determine exactly what's going on.
SGCornerStone

From: Troy, NY USA
Posts: 6
Member Since: 10/31/12
posted October 31, 2012 11:49 AM

Verizon re-posted a file for me....here is the full log including the get:

<220 CONNECT:Enterprise Gateway 2.1.00. FTP Server ready...
>AUTH TLS-P
<234 AUTH: command accepted. Securing command channel ...
>PBSZ 0
<200 PBSZ command accepted.
>PROT P
<200 PROT command accepted. Data transactions will be secured.
>USER ******
<331 Password required for *****.
>PASS *****
<230 User ***** logged in. Session Id: 29182.
>PBSZ 0
<200 PBSZ command accepted.
>PROT P
<200 PROT command accepted. Data transactions will be secured.
>PWD
<257 "***** " is the current working Mailbox ID.
>TYPE A
<200 TYPE set to A.
>PASV
<227 PASV Entering passive mode (192,76,85,180,217,160).
>TYPE A
<200 TYPE set to A.
>PASV
<227 PASV Entering passive mode (192,76,85,180,217,161).
>NLST
<150 Opening data connection.
<226 List complete. Closing data connection. 1 batches listed.
>PWD
<257 "***** " is the current working Mailbox ID.
>TYPE I
<200 TYPE set to I.
>SIZE 'SYW.NYRDUF.121030080327 '
<500 SIZE command not understood.
>PASV
<227 PASV Entering passive mode (192,76,85,180,217,163).
>RETR 'SYW.NYRDUF.121030080327 '
<150 Opening data connection.
<226 181,940 bytes transferred for 1 batch.
>QUIT
<221 Goodbye.
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted October 31, 2012 11:52 AM

Hello,

Nothing in your provided log indicates that EBCDIC mode gets used. Also, the log shows that your manually sending PROT P and PBSZ 0 are similarly unnecessary.
SGCornerStone

From: Troy, NY USA
Posts: 6
Member Since: 10/31/12
posted October 31, 2012 11:56 AM

Nick - I may used the wrong nonmenclature on there when I said EBCDIC in the beginning. The resulting transfer done as binary comes through as a file that appears to be encoded as EBCDIC.

I can remove the unrequired settings in there that you've pointed out. Do you believe that is why the Dart control is automatically setting the TYPE back to I before it sends the RETR?

Ie, do you think me removing those extra code lines is going to stop the Dart FTP control from setting the TYPE I before it does the RETR?
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted October 31, 2012 12:58 PM

Hello,

We're currently investigating a resolution; the cause of this is not related to your implementation. (But those Send()s are nevertheless unnecessary)
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted October 31, 2012 1:37 PM

Hello,

We set TYPE to I when requesting SIZE from the server (required for some servers), and if SIZE is not supported (threw an exception), we weren't setting it back to the original TYPE (we did when SIZE was supported). I've sent a download link for an updated dll that resolves this issue to your email address.
tim_tamu

From: College Station, TX USA
Posts: 1
Member Since: 12/10/12
posted December 10, 2012 12:00 PM

Hi, Nick -

I'm experiencing the same issue -- ASCII GET from mainframe for text file with no extension, ASCIIExtensions.Enabled = false, yet the file arrives as binary junk.

Would it be possible to get the same fix you provided for SGCornerStone?
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted December 10, 2012 3:04 PM

Hello,

I've sent a download link to the email address we have on file for your account. If you do not received it, please send an email into support@dart.com so that we can send it to the correct email address.

However, please note that this fix is only for servers that do not support the SIZE command. If your issue is due to a different cause, we will need to investigate it further.
Reply | PowerTCP FTP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX