- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2014 09:21 PM
So I have been working on an integration and was curious if anyone has successfully created a multipart/form-data outbound REST request with binary image data in Servicenow? With or without use of mid server. I know the request works because it works fine in Fiddler and Restify. Below is the body I am using, I have been able to post this exact message with a text file so I know the issue is with the binary I am sending. I have also tried base64. Does anyone have any tips or tricks for sending binary image data with Javascript? Any pitfalls or issues you have ran into in the past? Thanks !
--gc0p4Jq0M2Yt08jU534c0p
Content-Disposition: form-data; name="body"
goes with message
--gc0p4Jq0M2Yt08jU534c0p
Content-Disposition: form-data; name="attachment1"; filename="testpic.gif"
Content-Type:image/gif
Content-Transfer-Encoding: binary
${attachment}
--gc0p4Jq0M2Yt08jU534c0p--
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2014 10:11 PM
Yes, I finally got this done with a custom .jar file and Javascript probe. I wrote a reply on
JavascriptProbe and MID Server Script Includes-John Andersen
I believe you must be the same Jonathan, let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2020 01:28 AM
Hello Jonathan,
I'm using the same code as your above, but I'm stuck in the following response: "Evaluation error: HTTP response 403 (script_include:CopyAttachments; line 31)"
Does anybody have any idea what can be wrong, since I'm pretty sure that all the user credentials and permissions are okay..?
Any help would be appreciated! Thanks in advance!