first time ftp’er

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf first time ftp’er

  • Creator
    Topic
  • #49931
    Nate Kruse
    Participant

      Yup, I’m a first time ftp’er.  I’ve searched and read some previous threads, but I am just not getting it.

      I have 2 threads.  The inbound reads in a file from a directory, manipulates it with tcl and xlate, then outputs a new file.  What I would like the outbound to do is take that new file and ftp it to an vendor’s ftp site.  

      I have the vendor’s ftp site and username.  I assume that the thread protocol will be fileset-ftp, but unsure of what values to put in the fileset and ftp options tabs and where to reference the vendor’s ftp info.

      Any help would be greatly appreciated.

      Nate.

    Viewing 9 reply threads
    • Author
      Replies
      • #64150
        Robert Kersemakers
        Participant

          Hi Nate,

          I have included 2 screendumps; this should show you which fields to fill to send the outbound messages via ftp.

          In the first tab, you define the outbound file and style. In the second tab, you define the ftp account and ftp host.

          Hope this helps.

          Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

        • #64151
          Nate Kruse
          Participant

            That helps.  Thank you.

          • #64152
            Nate Kruse
            Participant

              Thanks again Robert.  With your screen printouts and some help from Viken, I was able to get my first ftp thread configured.

            • #64153
              Kevin Crist
              Participant

                i know this one is a little old , but helpful. i am also a first time ftp’er.

                should ftp be only for outbound threads or can inbound threads also use it. and what exactly is the login  and password for, sorry for the simple questions.

                thanks.

              • #64154
                Robert Kersemakers
                Participant

                  Hi Kevin,

                  Don’t worry: just ask your question.

                  You can use ftp for both outbound (placing files onto an ftp-server) and inbound (getting the files from an ftp-server).

                  Login and password are necessary to logon to the ftp-server. I have only dealt with ftp-servers where you need to logon with a certain username/password to get connection to the server. I know that ‘anonymous’ logon is possible, but not sure how to to configure it in Cloverleaf: no username, or username ‘anonymous’. It should be the same username/password when logging on manually from a prompt:

                  Code:

                  ftp
                  user

                  Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

                • #64155
                  Steve Pringle
                  Participant

                    This looks great.  I’m tryiing to do something slightly different however.

                    I have a thread that gets messages.  I’d like this thread to create a file per message and then ftp the file.  Can the file to be ftp’ed be created ‘virtually’ in the thread?  Or do I need to actually write the file to local disk, then ftp it?  If I have to write the file to local disk, can the thread remove it after it’s been ftp’ed?

                    Is any of this doable in one thread?

                    Any help greatly appreciated.

                    thanks,

                    Steve

                  • #64156
                    Jim Kosloskey
                    Participant

                      Steve,

                      I don’t think this is doable in a single thread.

                      What you could do is route the messages to a Fileset/FTP configured Outbound thread wherein you deploy a Tcl proc to change the metadata File name wiith each message. I think there is sample code in the contrib directory and I think there has been some posted on Clovertech. If you cannot find any I think we have at least one that is rather generic.

                      So the receiving system would then delete each file after processing it.

                      However, you might want to have a copy of that file for archival purposes (what if they say they did not get some file or set of files and you need to resend?). After all FTP really is not as reliable as we might like.

                      In the case where you think archival makes sense, then you might want to route to an outbound Fileset-Local thread using the proc to change the file name with each message. Then have a Fileset-Local inbound thread to get each file and route static raw to a Fileset/FTP outbound thread that delivers to the receiving system (don’t forget to have a Delete Tps proc to keep the files from being delted – after all these are your archive files).

                      Then you would need a mechanism to manage your archive (you probably don’t want to keep those files forever). I don’t see why you could not use another Fileset-Local thread to do the archival management with Directory Parse Tps Tcl proc(s) to do the management and use advanced scheduling to meet your management timings.

                      Another way would be to use a Tclproc at the Outbound Tps of the Fileset-FTP (example one just two threads) and in that proc do the file I/O to  write each message out to an Archive Directory before it is delivered to the receiving system.

                      It looks like there are a lot of different ways to do this.

                      The multiple thread to archive keeps everything right in front of you in the NetConfig and NetMonitor.

                      In my opinion File processing is a lot more complicated than real time processing.

                      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

                    • #64157
                      Steve Pringle
                      Participant

                        Jim,

                        Thanks for the info.  Your explanation makes sense and sounds reasonable, I’ll see if I can’t implement it.

                        I’ll look in the contrib dir for that sample code too.

                        thanks again,

                        Steve

                      • #64158
                        Michael Hertel
                        Participant

                          What you are asking is easy.

                          Here’s what we use:

                          You still want to define a “default” filename in the fileset-ftp protocol tab incase something goes wrong.

                          Define this in the outbound tps with args: {CTRFILENAME YourCounterName}

                          ######################################################################
                          # Name: ftp_change_filename_argv
                          # Purpose:
                          # UPoC type: tps
                          # Args: tps keyedlist containing the following keys:
                          #
                          [code]######################################################################
                          # Name: ftp_change_filename_argv
                          # Purpose:
                          # UPoC type: tps
                          # Args: tps keyedlist containing the following keys:
                          #

                        • #64159
                          Steve Pringle
                          Participant

                            Thanks Michael – looks good!

                        Viewing 9 reply threads
                        • The forum ‘Cloverleaf’ is closed to new topics and replies.