@@ -302,13 +302,13 @@ The following updates to the [React Native To-Do List demo app](https://github.c
302302
303303 const { uploadUrl } = response.data;
304304 try {
305- const body = Uint8Array . from ( new Uint8Array (data ) );
305+ const body = new Uint8Array (data );
306306
307307 const response = await fetch (uploadUrl , {
308308 method: " PUT" ,
309309 headers: {
310310 " Content-Length" : body .length .toString (),
311- " Content-Type" : " application/json " ,
311+ " Content-Type" : options ?. mediaType ,
312312 },
313313 body: body ,
314314 });
@@ -455,15 +455,15 @@ The following updates to the [React Native To-Do List demo app](https://github.c
455455 ```
456456 - Converts the input ArrayBuffer to an Uint8Array for S3 compatibility
457457 ```typescript
458- const body = Uint8Array.from( new Uint8Array(data) );
458+ const body = new Uint8Array(data);
459459 ```
460460 - Uploads the file with metadata (content type) to the pre-signed upload URL
461461 ```typescript
462462 await fetch(uploadUrl, {
463463 method : " PUT" ,
464464 headers : {
465465 " Content-Length" : body .length .toString (),
466- " Content-Type" : " application/json " ,
466+ " Content-Type" : options ?. mediaType ,
467467 },
468468 body : body ,
469469 } );
@@ -653,13 +653,13 @@ The following updates to the [React Native To-Do List demo app](https://github.c
653653
654654 const { uploadUrl } = response .data ;
655655 try {
656- const body = Uint8Array . from ( new Uint8Array (data ) );
656+ const body = new Uint8Array (data );
657657
658658 const response = await fetch (uploadUrl , {
659659 method: " PUT" ,
660660 headers: {
661661 " Content-Length" : body .length .toString (),
662- " Content-Type" : " application/json " ,
662+ " Content-Type" : options ?. mediaType ,
663663 },
664664 body: body ,
665665 });
0 commit comments