ngx-uploader

  • Version 11.0.0
  • Published
  • 285 kB
  • 1 dependency
  • MIT license

Install

npm i ngx-uploader
yarn add ngx-uploader
pnpm add ngx-uploader

Overview

Angular 2+ File Uploader

Index

Functions

function humanizeBytes

humanizeBytes: (bytes: number) => string;

    Classes

    class NgFileDropDirective

    class NgFileDropDirective implements OnInit, OnDestroy {}

      constructor

      constructor(elementRef: any);

        property el

        el: HTMLInputElement;

          property elementRef

          elementRef: any;

            property options

            options: UploaderOptions;

              property stopEvent

              stopEvent: (e: Event) => void;

                property upload

                upload: NgUploaderService;

                  property uploadInput

                  uploadInput: any;

                    property uploadOutput

                    uploadOutput: any;

                      method ngOnDestroy

                      ngOnDestroy: () => void;

                        method ngOnInit

                        ngOnInit: () => void;

                          method onDragLeave

                          onDragLeave: (e: Event) => void;

                            method onDragOver

                            onDragOver: (e: Event) => void;

                              method onDrop

                              onDrop: (e: any) => void;

                                class NgFileSelectDirective

                                class NgFileSelectDirective implements OnInit, OnDestroy {}

                                  constructor

                                  constructor(elementRef: any);

                                    property el

                                    el: HTMLInputElement;

                                      property elementRef

                                      elementRef: any;

                                        property fileListener

                                        fileListener: () => void;

                                          property options

                                          options: UploaderOptions;

                                            property upload

                                            upload: NgUploaderService;

                                              property uploadInput

                                              uploadInput: any;

                                                property uploadOutput

                                                uploadOutput: any;

                                                  method ngOnDestroy

                                                  ngOnDestroy: () => void;

                                                    method ngOnInit

                                                    ngOnInit: () => void;

                                                      class NgUploaderService

                                                      class NgUploaderService {}

                                                        constructor

                                                        constructor(
                                                        concurrency?: number,
                                                        contentTypes?: string[],
                                                        maxUploads?: number,
                                                        maxFileSize?: number
                                                        );

                                                          property contentTypes

                                                          contentTypes: string[];

                                                            property maxFileSize

                                                            maxFileSize: number;

                                                              property maxUploads

                                                              maxUploads: number;

                                                                property queue

                                                                queue: UploadFile[];

                                                                  property serviceEvents

                                                                  serviceEvents: any;

                                                                    property subs

                                                                    subs: { id: string; sub: any }[];

                                                                      property uploadScheduler

                                                                      uploadScheduler: any;

                                                                        method allContentTypesAllowed

                                                                        allContentTypesAllowed: () => boolean;

                                                                          method generateId

                                                                          generateId: () => string;

                                                                            method handleFiles

                                                                            handleFiles: (incomingFiles: FileList) => void;

                                                                              method initInputEvents

                                                                              initInputEvents: (input: any) => any;

                                                                                method isContentTypeAllowed

                                                                                isContentTypeAllowed: (mimetype: string) => boolean;

                                                                                  method isFileSizeAllowed

                                                                                  isFileSizeAllowed: (fileSize: number) => boolean;

                                                                                    method makeUploadFile

                                                                                    makeUploadFile: (file: File, index: number) => UploadFile;

                                                                                      method secondsToHuman

                                                                                      secondsToHuman: (sec: number) => string;

                                                                                        method setContentTypes

                                                                                        setContentTypes: (contentTypes: string[]) => void;

                                                                                          method startUpload

                                                                                          startUpload: (upload: { file: UploadFile; event: UploadInput }) => any;

                                                                                            method uploadFile

                                                                                            uploadFile: (file: UploadFile, event: UploadInput) => any;

                                                                                              class NgxUploaderModule

                                                                                              class NgxUploaderModule {}

                                                                                                Interfaces

                                                                                                interface BlobFile

                                                                                                interface BlobFile extends Blob {}

                                                                                                  property name

                                                                                                  name: string;

                                                                                                    interface UploaderOptions

                                                                                                    interface UploaderOptions {}

                                                                                                      property allowedContentTypes

                                                                                                      allowedContentTypes?: string[];

                                                                                                        property concurrency

                                                                                                        concurrency: number;

                                                                                                          property maxFileSize

                                                                                                          maxFileSize?: number;

                                                                                                            property maxUploads

                                                                                                            maxUploads?: number;

                                                                                                              interface UploadFile

                                                                                                              interface UploadFile {}

                                                                                                                property fileIndex

                                                                                                                fileIndex: number;

                                                                                                                  property form

                                                                                                                  form: FormData;

                                                                                                                    property id

                                                                                                                    id: string;

                                                                                                                      property lastModifiedDate

                                                                                                                      lastModifiedDate: Date;

                                                                                                                        property name

                                                                                                                        name: string;

                                                                                                                          property nativeFile

                                                                                                                          nativeFile?: File;

                                                                                                                            property progress

                                                                                                                            progress: UploadProgress;

                                                                                                                              property response

                                                                                                                              response?: any;

                                                                                                                                property responseHeaders

                                                                                                                                responseHeaders?: {
                                                                                                                                [key: string]: string;
                                                                                                                                };

                                                                                                                                  property responseStatus

                                                                                                                                  responseStatus?: number;

                                                                                                                                    property size

                                                                                                                                    size: number;

                                                                                                                                      property sub

                                                                                                                                      sub?: Subscription | any;

                                                                                                                                        property type

                                                                                                                                        type: string;

                                                                                                                                          interface UploadInput

                                                                                                                                          interface UploadInput {}

                                                                                                                                            property data

                                                                                                                                            data?: {
                                                                                                                                            [key: string]: string | Blob;
                                                                                                                                            };

                                                                                                                                              property fieldName

                                                                                                                                              fieldName?: string;

                                                                                                                                                property file

                                                                                                                                                file?: UploadFile;

                                                                                                                                                  property fileIndex

                                                                                                                                                  fileIndex?: number;

                                                                                                                                                    property headers

                                                                                                                                                    headers?: {
                                                                                                                                                    [key: string]: string;
                                                                                                                                                    };

                                                                                                                                                      property id

                                                                                                                                                      id?: string;

                                                                                                                                                        property includeWebKitFormBoundary

                                                                                                                                                        includeWebKitFormBoundary?: boolean;

                                                                                                                                                          property method

                                                                                                                                                          method?: string;

                                                                                                                                                            property type

                                                                                                                                                            type:
                                                                                                                                                            | 'uploadAll'
                                                                                                                                                            | 'uploadFile'
                                                                                                                                                            | 'cancel'
                                                                                                                                                            | 'cancelAll'
                                                                                                                                                            | 'remove'
                                                                                                                                                            | 'removeAll';

                                                                                                                                                              property url

                                                                                                                                                              url?: string;

                                                                                                                                                                property withCredentials

                                                                                                                                                                withCredentials?: boolean;

                                                                                                                                                                  interface UploadOutput

                                                                                                                                                                  interface UploadOutput {}

                                                                                                                                                                    property file

                                                                                                                                                                    file?: UploadFile;

                                                                                                                                                                      property nativeFile

                                                                                                                                                                      nativeFile?: File;

                                                                                                                                                                        property type

                                                                                                                                                                        type:
                                                                                                                                                                        | 'addedToQueue'
                                                                                                                                                                        | 'allAddedToQueue'
                                                                                                                                                                        | 'uploading'
                                                                                                                                                                        | 'done'
                                                                                                                                                                        | 'start'
                                                                                                                                                                        | 'cancelled'
                                                                                                                                                                        | 'dragOver'
                                                                                                                                                                        | 'dragOut'
                                                                                                                                                                        | 'drop'
                                                                                                                                                                        | 'removed'
                                                                                                                                                                        | 'removedAll'
                                                                                                                                                                        | 'rejected';

                                                                                                                                                                          interface UploadProgress

                                                                                                                                                                          interface UploadProgress {}

                                                                                                                                                                            property data

                                                                                                                                                                            data?: {
                                                                                                                                                                            percentage: number;
                                                                                                                                                                            speed: number;
                                                                                                                                                                            speedHuman: string;
                                                                                                                                                                            startTime: number | null;
                                                                                                                                                                            endTime: number | null;
                                                                                                                                                                            eta: number | null;
                                                                                                                                                                            etaHuman: string | null;
                                                                                                                                                                            };

                                                                                                                                                                              property status

                                                                                                                                                                              status: UploadStatus;

                                                                                                                                                                                Enums

                                                                                                                                                                                enum UploadStatus

                                                                                                                                                                                enum UploadStatus {
                                                                                                                                                                                Queue = 0,
                                                                                                                                                                                Uploading = 1,
                                                                                                                                                                                Done = 2,
                                                                                                                                                                                Cancelled = 3,
                                                                                                                                                                                }

                                                                                                                                                                                  member Cancelled

                                                                                                                                                                                  Cancelled = 3

                                                                                                                                                                                    member Done

                                                                                                                                                                                    Done = 2

                                                                                                                                                                                      member Queue

                                                                                                                                                                                      Queue = 0

                                                                                                                                                                                        member Uploading

                                                                                                                                                                                        Uploading = 1

                                                                                                                                                                                          Package Files (6)

                                                                                                                                                                                          Dependencies (1)

                                                                                                                                                                                          Dev Dependencies (0)

                                                                                                                                                                                          No dev dependencies.

                                                                                                                                                                                          Peer Dependencies (2)

                                                                                                                                                                                          Badge

                                                                                                                                                                                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ngx-uploader.

                                                                                                                                                                                          • Markdown
                                                                                                                                                                                            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/ngx-uploader)
                                                                                                                                                                                          • HTML
                                                                                                                                                                                            <a href="https://www.jsdocs.io/package/ngx-uploader"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>