Overview
TheS3M class is the core JavaScript class that handles multipart file uploads to AWS S3. It manages chunking, concurrent uploads, retry logic, and progress tracking.
Constructor
The File object to upload. This is a standard browser File object.
Class Constants
The S3M class defines several default constants that control upload behavior:Default chunk size in bytes (10MB). This is the size of each part in the multipart upload.
Maximum number of chunks that can be uploaded concurrently.
Maximum number of retry attempts for a failed chunk upload.
Instance Properties
After instantiation, the S3M instance has the following properties:The File object being uploaded.
The options object passed to the constructor.
The chunk size for the upload. Defaults to
DEFAULT_CHUNK_SIZE if not specified in options.Maximum number of concurrent chunk uploads. Defaults to
DEFAULT_MAX_CONCURRENT_UPLOADS if not specified.The name of the file being uploaded (from
file.name).The size of the file in bytes (from
file.size).The MIME type of the file (from
file.type).The HTTP client used for requests. Defaults to axios if not provided in options.
Maximum number of retries for failed chunks. Defaults to
DEFAULT_MAX_CHUNK_RETRIES if not specified.