diff --git a/src/uploadx/src/uploader.ts b/src/uploadx/src/uploader.ts index 4d4ce587..d1d4be33 100644 --- a/src/uploadx/src/uploader.ts +++ b/src/uploadx/src/uploader.ts @@ -44,7 +44,7 @@ export abstract class Uploader { /** * Minimum chunk size */ - static minChunkSize = 4096; // efault blocksize of most FSs + static minChunkSize = 4096; // default blocksize of most FSs /** * Initial chunk size */ @@ -146,6 +146,12 @@ export abstract class Uploader { this.name = file.name; this.size = file.size; this.mimeType = file.type || 'application/octet-stream'; + this.metadata = { + name: this.name, + mimeType: this.mimeType, + size: this.size, + lastModified: this.file.lastModified + }; this.stateChange = options.stateChange || noop; this.chunkSize = options.chunkSize ? options.chunkSize : Uploader.startingChunkSize; this.configure(options); diff --git a/src/uploadx/src/uploadx.service.ts b/src/uploadx/src/uploadx.service.ts index 1408a60c..754b3d0f 100644 --- a/src/uploadx/src/uploadx.service.ts +++ b/src/uploadx/src/uploadx.service.ts @@ -14,7 +14,7 @@ import { UploaderX } from './uploaderx'; @Injectable({ providedIn: 'root' }) export class UploadxService { - private uploaderClass: { new (f: File, options: UploadxOptions): Uploader }; + private uploaderClass: new (f: File, options: UploadxOptions) => Uploader; private readonly eventsStream: Subject = new Subject(); get events() { return this.eventsStream.asObservable();