Reputation: 1
I'm having great difficulty with chunking file uploads to Sharepoint Online using JSOM. Seems like REST does not have the same issues, and CSOM has more explicit type information.
From my understanding, there are three portions to the chunked upload: file.startUpload file.continueUpload file.finishUpload
In every case, the documentation lists type 'Stream' required. There is no stream type in the SP.js library. Some other posts on the subject suggest the type should be: SP.Base64EncodedByteArray()
That type will work when setting the content: (if a partial image is uploaded this way, when you try to open the file in sharepoint, it will show the partial image)
parameters.set_content(new SP.Base64EncodedByteArray(base64Data);
But when passing the Base64EncodedByteArray type to the 'Stream' parameter of startUpload, continueUpload, or finishUpload produces the error: 'Value cannot be null. Parameter name: stream'
After some digging, the following was passed under my attempt at executing 'finishUpload'
<Method Id="72" ParentId="69" Name="FinishUpload"> <Parameters> <Parameter Type="String">34721414-e1be-49aa-8641-7fad1a1290f4</Parameter> <Parameter Type="Number">0</Parameter> <Parameter Type="Dictionary" /> </Parameters> </Method>
So it appears that the 'Stream' parameter should be a dictionary object? The documentation is very lackluster in this regard, and I'm curious if anyone else has had any luck.
Thanks for any and all assistance!
Upvotes: 0
Views: 26