Problem downloading files with api call using UiPath.Web.Activities.HttpClient

Really I got two problems:

First: I know how to call it with the mentioned activity and I could retrieve a json but in another part of the process I have to download a .tar.gz using the Get property I guess. How can I save a .tar.gz file not being a text file?
Second: For big files. Any workaround? I mean some files will late an hour to be downloaded… Should I just set a bigger time response and just wait until the download finishes?

HI,

Can you try Filename For Response attachment property?

Second: For big files. Any workaround? I mean some files will late an hour to be downloaded… Should I just set a bigger time response and just wait until the download finishes?

Basically it’s necessary to set larger time at Timeout, I think.

Regards,

Thanks for your fast response. I have some doubts yet:

Filename for response attachment should be “.tar.gz” or the complete file name like TestFileDownload.tar.gz
I mean, the file is giving me error at open because a create it as a text file, is there any activity to save the file directly to a directory so I have not to store it in a variable and then write it?

HI,

Can you check mime type in HTTP response header?
And also can you share the text file which is saved by Filename For Response attachment property, if possible?

Regards,

Sorry, I cant share that info because it is company private info. Ill give you all the info I can:

When calling the webservice using Postman I can download a file and the response has this headers:

Using postman I just click send and download and when it finishes it asks me for a directory in what I want to save a XXX.tar.gz file witch contains: A folder and inside that folder another folder and then some text files .ldr witch can be readable with notepad++.

What I need is just to download that file and store it in a defined directory.

Thank you again

Hi,

To isolate cause, can you check Response Status? If it’s not 200, it may be necessary to review request.

Regards,

Response status is 200 when it is ok:

But what do this isolate Im not following you sorry

Hi,

I’d like you to check response status using HTTP request activity of UiPath.

Regards,

Im actually doing this:

Response content is a str varaiable:

Status is an int32 variable with 200 of default value.

Then I write a text file called Test.tar.gz in the desktop and when I try to open it with winrar is gives an error that is corrupted.

Hi,

Can you try to have ResponseContent blank and set filepath (such as "C:\temp\data.tar.gz") in Filename For Response attachment property as the following?

Regards,

I basically wasn’t using the inherent property to download the file so obviously the write text file activity was corrupting the downloaded file.

Thank you and have a nice day :smiley:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.