on 11-06-2013 2:21 AM
Hi Experts,
I have a pass thru interface that sends csv file and it needs to be zipped in the receiver directory. I've implemented AF_Modules/PayloadZipBean and AF_Modules/MessageTransformBean to set the contentType and assign to the filenamekey. The logs show that the payload is zipped but the processed file remains in CSV format.
I'm using Advantco party SFTP adapter btw.
Did I miss any step? Here are the module configs
I have enabled ASMA as well since I need the file name of the zipped file to be the same as the input csv file.
Appreciate your feedback. Thanks a lot!
Hi Mark,
Try changing the following:
1. Parameter names to zip.filenameKey and zip.Mode respectively. I'm 90% sure that those attribute names are case-sensitive, thus your configuration is ignored and replaced by default values.
2. If the above doesn't help, change the Mode to ZipAll and see what happens (unless you have more than one payload).
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark
The problem is that you are trying to generate the zip file name dynamically from source file name.
Since your source file is having .CSV as extension, the output file is also generating as CSV file.
This paramter zip.filenameKey will change the file name inside the zip folder.
So if you need to keep the output zip file name same as source file , then you need to write an module for passthorugh scenarios or if you have ESR objects then write an UDF and change the file name.
Let me know if need any help on the dynamic file name generation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Indrajit,
Thank you for the explanation. Actually, right now, I would just like to set the name of the zip file to be the same as the filename of the CSV. Then, just set a static file name (i.e. static.csv) inside the zip folder.
Input: helloworld01.csv
Output: helloworld01.zip
Inside: (static.csv)
Do I still need custom module for that? I thought ASMA would work for PayloadZipBean.
Mark, Indrajit,
The PayloadZipBean itself is capable of changing the name to .zip (along with compressing the payload). See more details here under zip.filenameKey:
http://help.sap.com/saphelp_nw04/helpdata/en/45/da9358a1772e97e10000000a155369/content.htm
Regards,
Greg
Hi Greg
I have gone through the documenation.So following is written there
zip.filenameKey
This parameter is only relevant for compressing.
Specify the information to be used to generate the file name of the compressed file:
○ payloadName
The name of the payload is used as the file name for the compressed file.
This is the default value.
○ contentType
For example, the content type is Content-Type: text/plain; name="name.txt".
The name of the compressed file is name.zip.
So zip.filenameKey will change the name of the compressed file, in other words the file inside the main zip file.
But main zip file name you have populate either by giving hardcoded value or by dynamic configuration.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.