Hi Team,
We are generating 2 different files using data extraction activity.
Data extraction 1 will create test_1.csv
Data extraction 2 will create test_2.txt
We need to club this test_1.csv and test_2.txt file as a single zip file 'myProject.zip' and need to send to SFTP.
Kindly help us to achieve this!
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @LakshmiPravallika ,
Try using below script,
execCommand('zip -r -j /sftp/my/path/myProject.zip /sftp/my/path/test_1.csv /sftp/my/path/test_2.txt');
Regards,
ParthaSarathy S
Views
Replies
Total Likes
Hi Lakshmi,
Please take a look at the documentation below and let us know if there are any questions. Do combine and zip both files into a single zip will likely take some scripting.
Views
Replies
Total Likes
Hi Thonis,
Thanks for providing me the link.But the documentation do not contain the steps to zip the files.
It only contain the steps to encrypt the files.
This doc doesn't help to achieve my use case of combining 2 files and zipping them into a single file.
Views
Replies
Total Likes
Hi @LakshmiPravallika ,
Try using below script,
execCommand('zip -r -j /sftp/my/path/myProject.zip /sftp/my/path/test_1.csv /sftp/my/path/test_2.txt');
Regards,
ParthaSarathy S
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi @ParthaSarathy and @LakshmiPravallika
Please restrain yourself to us execCommand when there is a JavaScript object to allow you to zip file.
Although the execCommand is there, we don't like it to be used as there is no control on what can be executed and it has been perceived as a security concern.
Please use ZipFile class instead and the getEntry
https://experienceleague.adobe.com/developer/campaign-api/api/m-ZipFile-ZipFile.html
ANYTIME, you use a File class, make you invoke the dispose function to release the resources used during the file processing, failing to do so exposes you to run out of resources and will require a full service restart.
execCommand works but is not recommended, ZipFile is the recommended approach.
Hope this helps,
Thanks
Denis
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies