Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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: 

0683p000009LuS6.gif0683p000009LuHL.gif

 

Here is my request from Postman:

0683p000009LuMe.gif

 

Could somebody help me with this?

Thanks.

 

 

Labels (2)
7 Replies
DilipSonar
Contributor
Contributor

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. 

 

Anonymous
Not applicable
Author

Hello,

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

 

Best regards

Sabrina

Anonymous
Not applicable
Author

Thanks for your response.

This is what I have in my tHttpRequest:

0683p000009LuSH.gif

 

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

 

Thanks.

 

Anonymous
Not applicable
Author

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.

cterenzi
Specialist
Specialist


@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

 

Anonymous
Not applicable
Author

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?

 

Anonymous
Not applicable
Author

Hi,

 

You could go to "Advanced settings" tab and select the option "upload file"

 

Regards,

YG Abhi


tfilfeFetchUploadFile.jpg