REST Attachment currupted file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2025 01:18 PM
Hi All
I need to send an excel file to an external API with post method. I'm using this code to send it I have a successful result , the excel file is attached in the client environment (it is not servicenow)
When I try to download the attachemtent , excel can't open it beacuse the file is corrupted
Do you know what could be the possible error on my script?
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2025 09:06 PM
So it means the file data is not sent correctly.
How does the 3rd party expect the file data base64encoded data or content stream?
Did they share the sample JSON request body on how they expect the excel data?
there is a article explaining about using multi-part and providing the code: Script to send multipart (including text and binary) RestAPI
And also there is a ready-to-use-solution in the Share: MultiPart Upload Helper
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 08:33 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 02:52 PM
Hi all,
I still have the same issue , I fund this KB article
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0745010
Do you think it would be works?
Regards