I’m having trouble trying to upload/create/process an asset using CMA (not SDK). I’ll explain my steps:
- I’m uploading an image.
- Im creating an asset with the id returned by the upload linked.
- I’m processing the asset.
I can see then the asset in Contentful web, but image says Loading like … forever, and never shows up.
I suspect it could be one of two things: either I am not providing the appropriate file for upload, or I’m not passing correctly the asset for processing it.
For the first I do the following:
` reader.onloadend = () => {
var arrayBuffer = reader.result
var bytes = new Int8Array(arrayBuffer);
this.props.uploadImage(bytes);
}
reader.readAsArrayBuffer(file)`
and for the second:
return axios .put( "https://api.contentful.com/spaces/" + space_id + "/assets/" + asset.data.sys.id + "/files/en-US/process", asset.data, config )
Any help would be appreciated. Thanks!