07-18-2017 02:31 PM
I would like to stream data directly to a zip file (without first writing the data to disk).
I want to dynamically set the name of the file inside the zip file (not the zip file, but the file it contains).
Given this file:
mydata.zip
myfile1.xml
I want to create mydata.zip file (which I can do and name properly), and name the internal xml file without first writing the xml to disk.
When I use the XML formatter, it creates output as output0, not as myfile1.xml.
If I read a file from disk, it correctly sets the file name, however if I use the XML formatter to create binary data to stream to the ZipFile Write component, I can’t find a way to set XML filename.
Any suggestions are greatly appreciated.
Thanks,
Judy
07-18-2017 03:06 PM
@jcampion, I think you’re almost there. With the ZipFile Write snap, make sure to check the Use input view label option. Then in the views tab, give the input view the name of the internal filename you would like.
07-20-2017 08:18 AM
Thank you so much. It worked!
09-29-2022 03:39 AM
Hi ,
I want to save file like input.file but it is giving .file as type.
Thanks,
Rameeja
07-18-2017 04:09 PM
@jcampion, Here is a way, if you want to set filename dynamically.
I am not sure about your pipeline design, But zip write always takes binary input. Place a mapper before document to binary snap and set “$[‘content-location’]” property with filename you want. that’s it 🙂.
Design:
Output:
hope this helps.