Hi,
I'm having trouble passing a URL through the download tool. Its an https link which, when i paste directly into a browser initiates a download. However, when I pass it through a text input to the download tool, I get a parse error on one of the attributes in the query string.
I'm sure I'm missing something really simple here!
Here's an example URL (they expire after an hour so I'm sure it won't work - you will get an expired request response):
Here's an example of the error response I receive in the download tool:
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AuthorizationQueryParametersError</Code><Message>Error parsing the X-Amz-Credential parameter; the Credential is mal-formed; expecting "<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request".</Message><RequestId>6E07F5E38B17DF48</RequestId><HostId>KvG6deDYqd+Tri7uVJDqXakzPlFJmtvCzcWIjhhAIUrVljqQmK6fUiSaErhqAwgYb199VZx8T/s=</HostId></Error>
I'm using the following settings in the download tool:
Basic:
Payload:
NOTE: if the hour passes, i get a "request expired" response instead as expected.
NOTE: the end process I'm going for is
a) request using the download tool a JSON response with the "subscription" details for the files available to me
b) parse the URLs out of that response
c) submit those URLs to the download tool to pull the files
parts a + b are working.
part c I tried but get the same error for each file that I pasted above for the single text input URL.
Solved! Go to Solution.
Hi Peter,
It looks like there are special characters in your AMZ Credentials that are encoded by the Download Tool which results in AWS not recognizing your request.
&X-Amz-Credential=AKIAI42R5GCTOOUYM44Q%2F20170412%2Fus-east-1%2Fs3%2Faws4_request
You could try a number of things which should make it work:
Hope this helps.
Cheers,
Wesley
Thank you Wesley!
That was exactly it. %2F = /
i also facing this problem I tried in many ways but it wont works.
Can you tell how did you solve this. this is my code
const imageLocation = encodeURI(url); fileTransfer.download(imageLocation, this.storageDirectory ,true).then((entry)=>{ }
i get error code 3
Thanks