Making a subdirectory on remote host with FTP

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Making a subdirectory on remote host with FTP

  • Creator
    Topic
  • #54741
    Michael Hertel
    Participant

      I am working on a project trying to send pdf files to Cerner CPDI system since we didn’t have much luck with CAMM.

      I will be extracting and decoding the base64 file out of an HL7 message.

      I’ve been told that the way this works, CPDI needs two files, 1 control file and one binary pdf file.

      The system will read the control file and process the pdf file (as long as I put a .tiff extension on it).

      Here’s the rub… The pdf (.tiff) files need to be in their own subdirectory for this to work.

      There are way too many of these subdirectories needed so they can’t be set up in advance.

      Here’s my question…

      Is there a way to issue a mkdir command on the remote host during a fileset-ftp transaction in Cloverleaf?

      Is it as simple as setting OBFILE in the metadata and Cloverleaf will create the remote subdirectory if it’s not already there?

    Viewing 1 reply thread
    • Author
      Replies
      • #82790
        Rob Lindsey
        Participant

          It all depends on the system you are FTPing to and how the user is created on that server.  

          Yes it is as simple as using the command ‘mkdir ‘ and if the server allows and the user has permission, it should create the new directory.  

          I have always chosen to do my FTP outside of the engine where I have a lot more control of things.  Now of course that was under much older versions of the CL engine.  I have not played around with fileset-ftp much in the newer versions of the engine.

          You might find that using UPOCs might give you better control in the long run.  Of course you could write that UPOC in TCL using ‘package require ftp’ , tclCURL, expect and/or java.

          Rob

        • #82791
          Terry Kellum
          Participant

            We always liked NCFTP.  Provides a rather robust scripting and error handling, plenty of information for logging, and could be easily scheduled by crontab.

            One thing you need to remember using an outside FTP facility, you need to first transfer the file and then rename it on your side for pickup.  Rename is an atomic operation that won’t ball you up on half-transferred files.  They may need that on the other end as well.

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