cancel
Showing results for 
Search instead for 
Did you mean: 

Log: Zip successfully processed, Reality: File doesn't get zipped

markbernabe
Active Participant
0 Kudos

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!

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member184681
Active Contributor
0 Kudos

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

markbernabe
Active Participant
0 Kudos

Hi Greg,

I've tried it earlier as well and the log just throws a warning. The output file remains uncompressed.

Module config used:

javier_alcubilla
Contributor
0 Kudos

Hi Mark

Use zip.mode instead of zip.Mode

The parameters are case sensitive

Regards

Former Member
0 Kudos

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.

markbernabe
Active Participant
0 Kudos

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.

Former Member
0 Kudos

Hi Mark

No ASMA alone will be not enough. Your sender file name is *.csv and you want your target file as *.zip.

ASMA is not going to change the .CSV to .zip. You have to change it by either adapter module or udf or java map.

former_member184681
Active Contributor
0 Kudos

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

markbernabe
Active Participant
0 Kudos

Hi Greg,

That's what I thought as well but I doesn't work so far for me. Btw, does it have to be AF_Modules/PayloadZipBean or localejbs/AF_Modules/PayloadZipBean in the Processing Sequence. Or it doesn't matter at all?

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Mark

In your receiver communication channel make the below changes and see if it works or not.

The file type should be binary

markbernabe
Active Participant
0 Kudos

Hello Indrajit,

I'm already using Binary for both File Transfer and File Type in my current configuration and it's not working.