I am storing the data on Azure and putting Content-Type in the headers field while uploading a chunk like so:
const headers: any = {
'Content-Range': contentRange,
'Content-Type': "image/svg+xml",
};
const responseData: any = await putChunk(url, chunks[currentChunkIndex].blob, headers);
Following is the way I am creating blobs and pushing them into a a chunk array:
var blob = new Blob([file.slice(start, end)], { type: 'image/svg+xml' });
const chunk = new FileChunk(blob, file.size, start, end, file.name);
chunks.push(chunk);
Following is the putChunk() function that simply sends a PUT request:
async function putChunk(url: string, data: any, headers: any): Promise<any> {
const options: any = {
method: 'PUT',
headers: headers,
body:
return await fetch(url, options);
}
No matter what the content-type is set to, of blobs and chunks likewise, it always resets to application/octet-stream. What am I missing?