Four Stars

How to perform a multi-part http post in Talend?

I tried tRestClient component to perform a file upload and it failed. I couldn't see the multi-part option in there. I can successfully upload using tFileFetch. Is it possible to write the response to a file when using tFileFetch for POST? Are there any other Talend components that can support multi-part uploads?

  • Data Integration
7 REPLIES
Five Stars

Re: How to perform a multi-part http post in Talend?

Hi,

check the cHTTP/cHTTP4 component in Route, should be possible to specify the content type.

 

Mirko

Five Stars

Re: How to perform a multi-part http post in Talend?

But in any case I don't understand why you have to upload a file using a form, instead of posting directly the content.

 

Mirko

Four Stars

Re: How to perform a multi-part http post in Talend?

This is what I trying to achieve in Talend. The reason I need multipart-form is that's what the server what I'm uploading to supports Screen Shot 2017-04-28 at 15.23.50.png

 

Five Stars

Re: How to perform a multi-part http post in Talend?

I am trying to upload (POST) file using tFileFetch component with multipart/form-data. I am not sure what I am doing wrong, it doesn't work for me.

Here are my screenshots: tFileFetch1.GIFtFileFetch2.GIF

Am I missing something?

Appreciate your help.

Nine Stars

Re: How to perform a multi-part http post in Talend?

What error are you encountering? Or does it complete without errors yet not upload the file?
Five Stars

Re: How to perform a multi-part http post in Talend?

Thanks for your response. 

I get the following response. But its not uploading the file.

==================================

Starting job TestJob at 09:55 15/05/2017.

[statistics] connecting to socket on port 3782
[statistics] connected
[statistics] disconnected
Picked up JAVA_TOOL_OPTIONS: -Djava.vendor="New Oracle"
Job TestJob ended at 09:55 15/05/2017. [exit code=0]

=======================================

Five Stars

Re: How to perform a multi-part http post in Talend?

Now I get the following response after restarted Talend:

Starting job TestScene7 at 14:09 15/05/2017.

[statistics] connecting to socket on port 3426
[statistics] connected
[INFO ]: org.apache.commons.httpclient.HttpMethodBase - Response content length is not known
Status Line: HTTP/1.1 200 OK
*** Response Header ***
Content-Type: text/xml;charset=utf-8
Content-Length: 233
Date: Mon, 15 May 2017 18:09:10 GMT
Server: Unknown
Connection: close
Picked up JAVA_TOOL_OPTIONS: -Djava.vendor="New Oracle"
[statistics] disconnected
Job TestJob ended at 14:09 15/05/2017. [exit code=0]

But its not uploading the data.