Attaching a txt file attachment to a task using Upload a binary file as an attachment

ShirshakP
Giga Contributor

Hi I am trying to use power automate flow that creates a task for an incident and then uploads a txt file with some content to this newly created task.
I tried using the service now action called "Upload a binary file as an attachment" and have confirmed all the parameters are correct. it keeps on failing saying bad request and the error message is "Invalid file type: application/json". I also noticed that "upload a binary file as an attachment" sets the content type to "$content-type": "application/octet-stream" and due to this attachment upload fails.
i am able to get it to work when i disable the mime type validation but its not the best practice and i am hoping to get it to work without having to disable the mime type validation. i ran into same issue using the HTTP API option as well. it works while mime type validation is disabled but breaks when its enabled.
Hoping someone can help me with this issue. Any guidance will be very much appreciated.

Thanks

0 REPLIES 0