Six Stars

How to upload file using tFileFetch component?

I am trying to upload (POST) files 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: 

tFileFetch2.GIFtFileFetch1.GIF

 

Here is my request from Postman:

postmanrequest.GIF

 

Could somebody help me with this?

Thanks.

 

 

6 REPLIES
Four Stars

Re: How to upload file using tFileFetch component?

I had faced a similar situation. Though there is a POST method in the component, seems it doesn't behave as expected.

I would suggest to create routine using Apache HTTP package/rest API to upload file while you resolve this issue. 

 

Moderator

Re: How to upload file using tFileFetch component?

Hello,

Could you please use tHttpRequest component with POST to send a file to a server to see if it works?

 

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: How to upload file using tFileFetch component?

Thanks for your response.

This is what I have in my tHttpRequest:

tHttpRequest.GIF

 

How can I pass the parameters (the ones I listed above in my Postman screenshot)?

 

Thanks.

 

Six Stars

Re: How to upload file using tFileFetch component?

I think, my question is, what should be the format of the "Post parameters from file". A sample file would really be helpful.

I am trying to upload files. 

Thanks.

Ten Stars

Re: How to upload file using tFileFetch component?


needtalend wrote:

I think, my question is, what should be the format of the "Post parameters from file". A sample file would really be helpful.

I am trying to upload files. 


According to the component docs (tHttpRequest), that file is the body of the post request.  The format is key=value pairs:

id=12345
name=Joe

 

Six Stars

Re: How to upload file using tFileFetch component?

Thanks for your response.

I mentioned the file path of the file that I am trying to upload (in my "Post parameters from file") like this:

auth="abc"&id="123"&file1=\"C:\Pictures\Sample Pictures\Desert.jpg\"

 

This doesn't work. Is this the right way to mention the file that I am trying to upload from tHttpRequest?