Sending files over webservice - binary data in HTTP request
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-05-17 01:43 PM
Hi,
Has any of you sent files from Blue Prism to an external endpoint using HTTP request (post)?
I was wondering how to attach binary data to HTTP request using Utilty - HTTP object.
Any ideas?
Thanks
Arek
8 REPLIES 8
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
20-05-17 05:14 PM
To send binary data over a rest webservice I would expect the data would need to be sent as some kind of text, potential within a JSON field using BASE64 text or something? Blue Prism provide the HTTP and JSON objects, i think the answer to this specific question about how best to structure your binary data within your JSON would probably require you to do some research on the internet.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-11-17 01:40 PM
Hello,
Any object in Blue Prism that can decode Base64 encoded text?
Thanks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-11-17 02:33 PM
Not that I know of, but it's simple enough to create your own object with a code stage and something like this (untested, but should give you a starting point at least):
var bytes = System.Convert.FromBase64String(encoded);
var decoded = System.Text.Encoding.UTF8.GetString(bytes);
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-06-18 08:30 PM
It is an old post but I ran into the same issue. The solution is as follows:
1) Create a calculation stage with and look up File function called LoadBinaryFile
2) Provide Filepath and Store Result In (data item has to be Binary)
3) Pass the binary data item to your webservice
I will be glad if you let me know if it helped (press Like) 🙂
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-10-19 07:50 AM
I tried this but the result was unsuccessful. I am trying to POST a file using Multi Part Form Data. But when I send the data as binary, I receive no response. Can you please let me know if this was successful to you?
------------------------------
Skanda Thalya Shankarananda
------------------------------
------------------------------
Skanda Thalya Shankarananda
------------------------------
Anonymous
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
21-10-19 08:32 AM
If multipart/form-data doesn't work for you, you must be constructing a request in a wrong way. Maybe your boundary string appears in a file.
Show us the code.
p.s. Server in general should not care how you encode data in most cases, but urlencoding big binary file might have a noticeable overhead.
------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------
Show us the code.
p.s. Server in general should not care how you encode data in most cases, but urlencoding big binary file might have a noticeable overhead.
------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
23-10-19 07:01 AM
I am trying to attach a file to JIRA. Documentation regarding that can be found here -> https://docs.atlassian.com/DAC/rest/jira/6.1.html#d2e3258
I have attached few screen shots. It would great if anyone can help me out with this. I read somewhere that in body we just cannot give file path but we have to encode it.
------------------------------
Anonymous
------------------------------
I have attached few screen shots. It would great if anyone can help me out with this. I read somewhere that in body we just cannot give file path but we have to encode it.
------------------------------
Anonymous
------------------------------
Anonymous
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
23-10-19 10:08 AM
Body can be either multipart/form-data or application/x-www-form-urlencoded
For application/x-www-form-urlencoded, you urlencode a file (and other values)
For multipart/form-data you send binary file, but you have to set unique boundary and add other fields to request body.
https://dev.to/sidthesloth92/understanding-html-form-encoding-url-encoded-and-multipart-forms-3lpa
------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------
For application/x-www-form-urlencoded, you urlencode a file (and other values)
For multipart/form-data you send binary file, but you have to set unique boundary and add other fields to request body.
https://dev.to/sidthesloth92/understanding-html-form-encoding-url-encoded-and-multipart-forms-3lpa
------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------
