Bucci
June 14, 2019, 9:27am
1
Hi,
I’m using http request activity to get documents from url.
The problem is that I don’t know the extension (.pdf, .xlsx, .doc) of the reponse.
It’s possibile to save the result with the extesion rerturned from http request ?
What’s the value I have to write in the ResourcePath property ?
Tkx
1 Like
Pablito
(Pawel Wozniak)
June 14, 2019, 9:58am
2
Hi @Bucci ,
Welcome to the Community!
Each document has it’s own markers in raw code.
Example:
PDF
HTML
DOC
XLSX
Maybe you could base on this to determine the file extension.
Bucci
June 14, 2019, 10:00am
3
thanks Pablito,
how can I read the raw code ?
HareeshMR
(Hareesh Madasi)
June 14, 2019, 11:02am
4
Hi @Bucci ,
Can you post the response you got if possible?
May be the response contains certain key words like “file”, “status”, “result” or whatever it is.
If you are getting the response, then the file name should include in any of the headers or the response
Pablito
(Pawel Wozniak)
June 14, 2019, 11:26am
5
Can you tell me the example of address you are using for Http Request
activity? Normally if web address is pointing to particular file it has it’s extension at the end of address.
Bucci
June 17, 2019, 9:59am
7
Hi HareeshMR,
I don’t know how get the response. Shall you help me please ?
I’m using HTTP Request Activity and I don’t know what’s the parameter/value I have to get the rensponse
thx
Bucci
June 17, 2019, 10:00am
8
Hi Pablito, the request has only a key to get the document, without extension or file type
HareeshMR
(Hareesh Madasi)
June 17, 2019, 10:02am
9
@Bucci ,
Create variables in the headers and result. try to print them using message box. Take screenshots and post them…
Bucci
June 17, 2019, 1:07pm
10
Hi,
using a message box: with some test case UiPath crash.
I try to invoke manually (with the wizard) and I understand that I need to read Content-Type.
For Example
Response Status: Completed
Status Code: 200
Content-Type: message/rfc822;charset=utf-8
or
Response Status: Completed
Status Code: 200
Content-Type: application/pdf;charset=utf-8
There is any way to read Content-Type from the http response?
HareeshMR
(Hareesh Madasi)
June 17, 2019, 1:11pm
11
You are passing the content type as header to the request, then output will with the extension you passed to the request.
If you are trying to download the file without sending any content type header, then you may get it in the output headers.
Can you try saving the output headers and output result after the request (Not in Preview Request)
1 Like
Bucci
June 17, 2019, 1:58pm
12
I have a problem … I don’t have option to write output headers into a variable and yes I’m
trying to download the file without sending any content type header
HareeshMR
(Hareesh Madasi)
June 17, 2019, 2:29pm
13
That’s strange thing . Can you try upgrading or downgrading the http activities?
Bucci
June 17, 2019, 3:28pm
14
I try … I don’t have output headers field
HareeshMR
(Hareesh Madasi)
June 17, 2019, 3:47pm
15
Which version of UiPath you are using? And what is the version of UiPath.web.activities?
@Bucci
Bucci
June 17, 2019, 4:06pm
16
UiPath version: 2017.1.6435
UiPath.web.activities: 1.4.1.0
If I try to Update I have the error message below
HareeshMR
(Hareesh Madasi)
June 17, 2019, 5:33pm
18
The latest version is 1.4
Bucci
July 1, 2019, 11:03am
19
Hi,
I solved the problem reading the first 4 byte of the stream returned as a file
Thank’s for all your help
2 Likes
I have the same issue. Can you expand on how you solved this?