FTP Error handling

wakestarwakestar Member Posts: 207
Hi all

there are a lot of samples in this forum how to use FTP transfer to up-/download files with navision. But does anybody have a solid error handling?

I wrote a Form which is running with a timer. Twice a day the form writes a txt-File and runs a cmd-script which uploads the txt-file to a ftp-server. It's also possible to run the export manually with different parameters, etc.. Everything works fine... except ... the ftp upload fails for some reason. And yes, I'm able to write a ftp-log but the Navision - user is too lazy to check this log every day. He wants a Message when the ftp-upload fails.

Any tips? :-k

Thank you :)

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Can't you just read the ftp-log, using Navision, and display a message when some error is listed in this log?
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • wakestarwakestar Member Posts: 207
    Can't you just read the ftp-log, using Navision, and display a message when some error is listed in this log?

    a successful log:
    Ftp> Verbunden zu ftp.xxxx.xxxxxxxx.ch.

    open ftp.xxxxx.xxxxxx.ch
    220 donna Microsoft FTP Service (Version 5.0).
    Benutzer (ftp.xxxx.xxxxxxx.ch:(none)):
    331 Password required for xxxxxxxxxx.

    230 User xxxxxxxxx logged in.
    Ftp> Ftp>
    put scttoweb.csv
    200 Port command successful
    150 Opening data channel for file transfer.
    226 Transfer OK
    FTP: 64d Bytes gesendet in 0.74Sekunden 140.39KB/s

    ftp> close
    221 Goodbye
    ftp> Bye

    now the easiest way would be to search for "226 Transfer OK"
    if this line is missing... the ftp upload probably failed....

    now this form is running on a dedicated computer... and the lazy user is working on a different pc. Now I need to create dynamically an e-mail message to... d'oh!... #-o
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Nobody has said it would be easy ;-)
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • girish.joshigirish.joshi Member Posts: 407
    I would create a .net control ftp client. Have errors in the control generate an event (not an error). Then have navision handle the event.

    the basics on creating the .net control are here

    http://www.ondotnet.com/pub/a/dotnet/20 ... dotnet.htm

    of course, you'd have to make this follow com.
  • Tarek_DemiatiTarek_Demiati Member Posts: 112
    Try to experiment with the Cute FTP API

    http://www.mibuso.com/forum/viewtopic.p ... hlight=ftp
Sign In or Register to comment.