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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] POSTing a file to a website

Hi everyone!
I've got a task which I'd love to use TOS for but I can't for the life of me work out how to accomplish it.
There is a website (protected by apache basic auth) which requires me to POST a file (which happens to be a CSV). I can manage the first bit - getting the data, but I'm not sure about the second and third bits, namely forming this data into a CSV file and then using HTTP POST to send it to this other website.
For those that know Perl, here is a snippet of the code we have which is doing what I'd like TOS to do:
         
my $ua = BrowserUA->new(
agent => "Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1",
);
my $req = POST $url,
"Content-Type" => 'multipart/form-data',
"Content" => ,
];

Has anyone got any hints that they can give me? I'm especially confused about the final bit of POSTing to the website as I can't see how to post a file (values aren't IN a file, I want to upload the actual file). I believe the content type above is making this happen, but I can't see how to do this in TOS.
Thanks in advance.
Labels (2)
15 Replies
Anonymous
Not applicable
Author

I've solved this!!
The key was not to use tHttpRequest at all. The correct component to use is tFileFetch. Despite it's name, it can send a file too. Worked straight away, very simple.
Anonymous
Not applicable
Author

Nice 🙂 But still I don't know why the tHttpRequest didn't work for you.
Anonymous
Not applicable
Author

Yep, that is a mystery, and if I needed to POST the file as well as other things, I may well have been stuck. I might look into it one day if I get the time. For now though, I can get on with my project 0683p000009MACn.png
Anonymous
Not applicable
Author

Hi aiclara,
I need to to do the same thing as you did. Can you show me how to use tFileFetch instead of tHttpRequest?
Thanks.
Anonymous
Not applicable
Author

You guysssssss, come on since when can you make a http request to a https URL. Haha lol your missing a whole  layer of encryption. If no one has figured it out after a difference of more than 3 years! Cheers.
joe86
Contributor
Contributor

@aiclara
Hey, this is a pretty old post. By any chance, do have the details of how to use tFileFetch to Upload/Post a file (from my local hard disk) to a web ( https://clientconn.sharefile.com/share/upload/r773a1b7922e44cca)