Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3637

Sharepoint 2019 Rest API - Upload file to Rich Text field

$
0
0

I am trying to upload a file to a rich text field on a sharepoint list using the REST API. In other words, trying to mimic the behaviour of the 'Upload File' option on the Insert tab of the ribbon when editing the field.

I am optimistically trying to do this is in the same way I would update any other field on a sharepoint list i.e. by POSTing to the /lists/getbytitle('ListName')/items(ID) endpoint and including the field name / file content in some JSON in the body of the request. I've tried various encoding of the file content before passing it in, and also different headers / header values to no avail. I am consistently getting a 500 code response with message 'Offset outside string'. I thought this might have something to do with the Content-Length header, whose value I have set to the length of the file, but apparently not

I don't know if the Rest API allows you to do this? If it does, can anyone provide some pointers on the correct configuration of the call?


Viewing all articles
Browse latest Browse all 3637

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>