Hi, I'm trying to upload an image (photo jpg) to a course offering. I'm using the API listed here:
https://docs.valence.desire2learn.com/res/course.html#put--d2l-api-lp-(version)-courses-(orgUnitId)-image
And I'm trying to follow the instructions for a "simple" upload here:
https://docs.valence.desire2learn.com/basic/fileupload.html#simple-uploads
But obviously I'm doing something wrong.
I'm sending this in the body (as a postfield):
CURLOPT_POSTFIELDS => array(
'--xxBOUNDARYxx
Content-Disposition: form-data;
name="Image";
filename="module-cover.jpg"
Content-Type: image/jpg' => '',
'file'=> new CURLFILE('/path_to/module-cover.jpg'),
'--xxBOUNDARYxx--' => '')
The upload supposedly "succeeds" with a 200 response.
When I go to Course > Course Admin > Course Offering Information, the name of the image shows up as the course image, but it shows zero bytes.
If I manually add this same image via the Brightspace UI (Course Offering Information page), it works and displays as expected.
Any advice?
Thanks!