- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-04-22 09:11 AM
Utility - File Management [Extended C#] seemed to have the right action as 'Download File as Binary'.
But the action returned False Success even if HTTP Status Code equals 200 - OK.
What's wrong with my code?
A screenshot is attached.
Thanks in advance.
Answered! Go to Answer.
Helpful Answers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-05-22 03:27 PM
Thank you for using Blue Prism.
The problem seems to be that the code in the download elements is relying on a response header called Content-Disposition. Now, it seems that its null, hence the null exception you are getting when the process tries to retrieve the filename.
Now, if you are familiar with C#, you could just edit the code as shown below:
if (responseMessage.Content.Headers.ContentDisposition != null)
This code can be found on the code page of the Download File As Binary action. The downside is that in this example the filename will not be returned. I will need to spend more time to see how this might be resolved in full. In the interim, I hope this helps.
Once again, thank you for being an SS&C Blue Prism user.
regards
Geoff HIrst
SR DX Engineer, Integration and Enablement, Blue Prism Digital Exchange
-- Further Note. The problem may actually be that the website isn't responding how it should be. This link explains the header that is the issue here https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition.
If you try to download from another site, do you get the same problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-04-22 09:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-05-22 03:27 PM
Thank you for using Blue Prism.
The problem seems to be that the code in the download elements is relying on a response header called Content-Disposition. Now, it seems that its null, hence the null exception you are getting when the process tries to retrieve the filename.
Now, if you are familiar with C#, you could just edit the code as shown below:
if (responseMessage.Content.Headers.ContentDisposition != null)
This code can be found on the code page of the Download File As Binary action. The downside is that in this example the filename will not be returned. I will need to spend more time to see how this might be resolved in full. In the interim, I hope this helps.
Once again, thank you for being an SS&C Blue Prism user.
regards
Geoff HIrst
SR DX Engineer, Integration and Enablement, Blue Prism Digital Exchange
-- Further Note. The problem may actually be that the website isn't responding how it should be. This link explains the header that is the issue here https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition.
If you try to download from another site, do you get the same problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
13-05-22 03:07 AM
The data item can be filled with the correct data I wanted.
It also works for downloading another website.
Thank you so much.