jitterbit

Jitterbit - Move multiple files from one location to another


  1. I have source as local file and target as File share.
  2. I want to move all files from local file folder to file share folder.

Please help me to do this.


Solution

  • When you say local, are you referring to local to your private agent server? If so, you could do run FileList(), then ReadFile(). Then just write the files back to your target location as an FTP (or, just to a shared folder on the Jitterbit server). If I'm off on what you are trying to do, please let me know. Happy to help out.

    <trans>
      $sourceFileNames=FileList("<TAG>Sources/Read_All_Test_Files</TAG>"); 
      $numberofFiles=Length($sourceFileNames); 
      While($numberofFiles>0, 
        $fname=$sourceFileNames[$numberofFiles-1]; 
        WriteFile("<TAG>Targets/Move_Test_Files</TAG>",ReadFile("<TAG>Sources/Move_Test_Files</TAG>",$fname),$fname);
        $numberofFiles--;
      ); 
    </trans>