NetTalk Central

Author Topic: FTP not sending - Thoughts?  (Read 7991 times)

Rick

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
FTP not sending - Thoughts?
« on: December 08, 2014, 07:19:28 AM »
I have been using NetTalk FTP in this multi-DLL app for the last ten years.  It transfers txt files from the app to a Unix box for that machine to use in production.  NetTalk was recently upgraded from 8.24 to 8.32 and the FTP stopped working; the installation was moved back to a saved version that uses 8.24 so they're up and running.  I, on the other hand, am stumped.

In attempting to move forward to NT 8.32 I've changed to the newer version of sending using "SendFileOverFTP" calling FTPFile,... straight from the FTP demo.  Here's the issue.  If I run the demo and substitute the FTP address, username and password and a test file the demo works just fine,... no problems; file lands and everything looks good.  When I copy that same information in to the multi-dll application implementation of "SendFileOverFTP" calling "FTPFile" and then use a menu call from the main menu,... I thought starting a new thread would help,... the send window (FTPFile) just flashes, a zero (o) is returned and it says it was successful, but nothing arrives at the Unix box FTP site.  Though it is setup just like the demo, something fails.  Something in the multi-DLL is not set up correctly, but nothing has changed in that set of applications from the version that worked for NetTalk 8.24.

I'm missing something but I have no idea what.  CW is 9.0.10376 (Gold). For what it's worth String Theory is 2.09.  I haven't turned on the debugging for NetTalk yet, but that's my next step. 

I thought maybe someone here would have "crossed this bridge" already. 

Thanks in advance!  Rick Dafler

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: FTP not sending - Thoughts?
« Reply #1 on: December 08, 2014, 10:22:47 PM »
Hi Rick,

Fortunately doing the next step is probably not too hard. The number of possible problems (given that ti is working in the example) are limited - and the built-in debugging will help.

The key is that you have a working one, and a non-working one. So you need to "watch" both of them to understand where they diverge.

the starting point I think is to set
parms.pShowDetails      =  true
in both cases.

When this is on the FtpFile window will not automatically close, and will open in "details" mode, showing you the Conversation between the server and the client. (Be aware that everything is in plain-text, so if you post any of that log here then please erase or replace the user and password text.)

Hopefully looking at the details of the one that failed should give you a big hint as to what might be the problem.

From a multi-DLL perspective there's nothing really different in a multi-dll setup. The only thing you have to remember is that the nettalk classes are in the data dll, so you need to compile that if you change any net*.inc or net*.clw files (or update nettalk.) Your FTPFile and SendFileOverFtp can be in any DLL - and can be in different DLL's.

One thing you can check;
In the FtpFile procedure, Done method, is a little bit of embed code. It should read;

  case lower(clip(self._Command))
  of 'putfile'   
  orof 'getremotefile'
    If pParms.pShowDetails = 0
      post(event:closewindow)
    else
      Conversation = clip(Conversation) &  '===== File Done  =====<13,10>'   
      Conversation = clip(Conversation) &  '===== Click Close to close window =====<13,10>'   
    End 
    Ans = 0 ! success
  end 


Early versions of this example had an incorrect version of this code.


Keep me posted to your progress.

cheers
Bruce




Rick

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: FTP not sending - Thoughts?
« Reply #2 on: December 09, 2014, 06:36:27 AM »
Bruce,

Thanks for the prompt response.  I was going to 'bug' you Wednesday if I hadn't heard anything. :)

So, I'm an almost a happy camper at this point.  I changed up the code in the Done method embed; it was not as you posted.  I also turned my debug view back on, just the Clarion stuff this time not the full NetTalk log and I placed a message to ensure that the parms.pShowDetails = True was 'coming through.' 

Note that parms.pShowDetails is True in both the FTPDemo and in my multi-app example. Other than the sent file not being sent, that's been a big question,... the details do not show in the multi-app example but they do in the demo.  I'll have to pull the FTPFile listing up side by side, but I have every confidence that they're the same procedures.  I'll let you know what I find.

On a happier note, the file was sent this time.  Actually, I did it twice just to assure myself that it wasn't a fluke.  Other than the embedded debug message and changing the Done method embed I haven't changed anything.  And I still don't have the "conversation" popping up.  (Long term I don't want it anyway, but it would be nice to know why it's in one and not the other, heh?)

Thanks for your help.  I'll let you know what I find next.
Rick Dafler

Rick

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: FTP not sending - Thoughts?
« Reply #3 on: December 09, 2014, 07:50:09 AM »
Bruce and anyone else that's interested,

Well that was interesting.  When I compared the two FTPFile procedures I found another difference in addition to the Done method embed.

The embed in the window init method, after the open window which reads --
if pParms.pHideWindow
  Window{prop:hide} = 1
End 
if pParms.pShowDetails 
  pParms.pShowDetails = 0 ! the button itself turns it back on.
  post(EVENT:Accepted,?DetailsButton)
end
post(EVENT:Accepted,?StartButton)     
ans = -1 ! assume failed.

was missing the line "pParms.pShowDetails = 0 ! the button itself turns it back on"

At some point in working on all this I obviously picked up the 'bum' example of the FTPFile and TXA copied it over in to my multi-DLL app.  I never bothered to compare them before this point since I wasn't doing anything in that procedure.  I've recopied that procedure in to my app from the demo app now and all is working as advertised (file is transferring nicely,... in other words). 

Hope all this helps someone else who may run in to this issue.

Thanks again.
Rick D.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: FTP not sending - Thoughts?
« Reply #4 on: December 09, 2014, 10:04:22 PM »
thanks Rick.

cheers
Bruce