08-02-2020 12:00 AM
I am trying to transfer all files in folder from one location to other. If I did simply as below screenshot then it works
But as per my scenario I need to change filename and path in-between, so I changed it to below pipeline but it only export one file (1st file) not for all files in folder.
Please advice, how can I export all files.
08-06-2020 07:53 AM
Hi Munish,
Good day, what I will do is use a mapper (change input/output view to binary) that will receive the binary from the multi-reader from this mapper it will also update the binary header property content-location which you can use in the file writer
You can also use your pipeline, in the JSON formatter add a binary header property content-location
e.g.
then in the file writer you can then use the binary header property content-location
Thanks,
EmEm
08-06-2020 08:00 AM
BTW, the filename that you will assign needs to be unique for each streaming document otherwise it will be overwritten by the next streaming document and you will end up just a single file (the last document file to stream)
for unit testing, probably you can use Math.randomUUID() as Date.now formatted to milliseconds sometimes overlaps and might cause duplicate filenames
08-06-2020 04:52 PM
Thanks for response. question was it was not working with multiple files trasfer/copy, I got it worked, there is a property need to enable in json formatter snap that default is false.
thanks