Our team has implemented the AWS S3 SDK for uploading files from a browser to S3 buckets. To prevent UI rendering and interaction issues caused by large file uploads, we decided to move the upload process into a Web Worker thread. This solution allows users to freely navigate and interact with our single page application without interruptions.
Small file uploads work smoothly, but we encountered a problem when attempting to upload big files. The S3 SDK splits the file into chunks for individual uploading. Upon receiving an XML response from the server, the S3 SDK attempts to parse it using the DOMParser class, which is not accessible in the Web Worker scope.
We are exploring options to polyfill the DOMParser capability within the Web Worker environment so that the S3 SDK can successfully handle uploads. Is there a way to achieve this?