- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2016 11:49 PM
Hi, I developed an application in ASP.NET Web API that allows me to upload attachment to an incident when this is created, all this using Service-Now REST API and Table API. I works perfect in the development environment (locally) but when I deploy it to production (MS Azure) I'm getting an odd issue: the file is uploaded but when I try to check directly in Service-Now, its opens/download as a corrupt file. I tried with different kinds of files (PNG, BMP, PDF,...) but I'm getting the same issue. Also, I double checked the Content-Type header and is correct in every case.
BTW.: We have the latest upgrades of May 2016
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2016 12:54 PM
To resolve this, using RestSharp, I'm using the Stream of the file instead of saving the file in the website and later uploading to ServiceNow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2016 01:42 AM
Hi Diomedes,
Are you using the REST attachment api?
This could be the best approach.
If so you should be aware that a couple of the curl code snippets, displayed by the API Explorer, for uploading attachments are incorrect.
ServiceNow KB: PRB646918: REST API Explorer Attachment API curl snippet problems (KB0551442)
If the above is not relevant, could you supply more details on how you are carrying out the upload?
Best Regards
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2016 06:24 AM
Hi Tony, I think that you misunderstood my problem: I don't have any issue to create an attachment to an incident, the problem is when I use the same process in Microsoft Azure Websites.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2016 12:54 PM
To resolve this, using RestSharp, I'm using the Stream of the file instead of saving the file in the website and later uploading to ServiceNow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2016 07:12 AM
Hi,
I'm struggling to get attachments to upload (using HttpClient in C#), are you able to share your code?
Currently receiving an error "Requested URI does not represent any resource"
Thanks,
Tim.