API Resumable uploads saving step returns HTTP:500

Corné.O.116
Corné.O.116 Posts: 5 🌱
edited September 19 in Development

Hi,

I've gone through the documentation and a couple discussion here, but I have not been able to complete the final file saving step.

Acquiring the upload key:

Gives me a location - which contains the key

then using that we post the file:

And finally we save it to the folder - this breaks :(

Thank you,
Corné

Answers

  • Viktor.H.147
    Viktor.H.147 Posts: 47
    edited September 27

    The response of a 500 indicates Brightspace is not handling an error condition properly, so this should be logged with D2L as a defect (the defect might be "we need to send you a better, 4xx-series error message").

    I notice in the documentation that it advises that your relative path provided in the last step must already exist for you to use it. It seems like you want to be putting a test image so at the end of the day it will be in ./test/test.png; have you confirmed that the ./test/ folder already exists?

    (The documentation about what kinds of values the relative path parameter could also definitely be improved here: it seems like the implementation intends to (a) remove slashes at the front of your relative path value, and then will (b) jam it onto the end of the course's manage file path to produce a "full path to a folder" (that must already exist), and then (c) jam a single "/" onto the end of the full path and then put your uploaded file there: so /test becomes test then //<coursepath>/test then //<coursepath>/test/test.png and the API wants that //<coursepath>/test/ folder to already exist before you try to save your uploaded file there.)

  • Corné.O.116
    Corné.O.116 Posts: 5 🌱

    Hi Victor,

    I've confirmed that the path does exist and it returns the same issue with a empty relative path. I might just log it so that

    should be logged with D2L as a defect (the defect might be "we need to send you a better, 4xx-series error message").

    I might have an answer to this but can only tackle it next week. I'll get back to you asap.

    Thanks,
    Corne