.zip file transferring as post and saving with additional label.

Five Stars

.zip file transferring as post and saving with additional label.

Hi All,

 

I have rest service, I am sending .zip file to it with post request and which consumes multipart. I am able to see the content once i hit the service. But i want to save the .zip with additional labels.[labels will be send as additional parameters to the request]. if .zip is x.zip i want to save it as x_y.zip. 

 

I tried it with FileOutputRaw. but i cant dynamically add y variable.


Accepted Solutions
Sixteen Stars

Re: .zip file transferring as post and saving with additional label.

This is just a timing issue. After you have received your data, don't immediately write it to a file (using the tFileOutputRaaw). Instead, calculate your parameters and work out your filename, then pass the data to a tFlowToIterate. Connect that (like in your screenshot) to a tFixedFlowInput. Your data will be stored in a globalMap variable. Retrieve that globalMap variable and use it in the tFixedFlowInput for your raw file data (I'm assuming it is stored as an Object). Then connect this to your tFileOutputRaw and use the filename calculated (also stored as a globalMap).

 

The reason this is causing you an issue is that as soon as the subjob is started, the filename of a tFileOutput component, is set. So if you are calculating the name in the subjob, it won't work. If you use the iterate link (as described) it essentially starts a new subjob. If the value of the filename is known by that point, it will work.


All Replies
Sixteen Stars

Re: .zip file transferring as post and saving with additional label.

This is just a timing issue. After you have received your data, don't immediately write it to a file (using the tFileOutputRaaw). Instead, calculate your parameters and work out your filename, then pass the data to a tFlowToIterate. Connect that (like in your screenshot) to a tFixedFlowInput. Your data will be stored in a globalMap variable. Retrieve that globalMap variable and use it in the tFixedFlowInput for your raw file data (I'm assuming it is stored as an Object). Then connect this to your tFileOutputRaw and use the filename calculated (also stored as a globalMap).

 

The reason this is causing you an issue is that as soon as the subjob is started, the filename of a tFileOutput component, is set. So if you are calculating the name in the subjob, it won't work. If you use the iterate link (as described) it essentially starts a new subjob. If the value of the filename is known by that point, it will work.

Five Stars

Re: .zip file transferring as post and saving with additional label.

Thank you so much  Smiley Happy

Sixteen Stars

Re: .zip file transferring as post and saving with additional label.

Not a problem. Glad to help :-)