Help with uploading photo image to course offering via API
Hi, I'm trying to upload an image (photo jpg) to a course offering. I'm using the API listed here:
And I'm trying to follow the instructions for a "simple" upload here:
But obviously I'm doing something wrong.
I'm sending this in the body (as a postfield):
CURLOPT_POSTFIELDS => array(
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.