ng2-file-upload

  • Version 7.0.1
  • Published
  • 221 kB
  • 1 dependency
  • MIT license

Install

npm i ng2-file-upload
yarn add ng2-file-upload
pnpm add ng2-file-upload

Overview

Angular file uploader

Index

Classes

class FileDropDirective

class FileDropDirective {}

    constructor

    constructor(element: ElementRef);

      property element

      protected element: ElementRef;

        property fileOver

        fileOver: EventEmitter<any>;

          property onFileDrop

          onFileDrop: EventEmitter<File[]>;

            property ɵdir

            static ɵdir: i0.ɵɵDirectiveDeclaration<
            FileDropDirective,
            '[ng2FileDrop]',
            never,
            { uploader: { alias: 'uploader'; required: false } },
            { fileOver: 'fileOver'; onFileDrop: 'onFileDrop' },
            never,
            never,
            false,
            never
            >;

              property ɵfac

              static ɵfac: i0.ɵɵFactoryDeclaration<FileDropDirective, never>;

                property uploader

                uploader?: FileUploader;

                  method getFilters

                  getFilters: () => string;

                    method getOptions

                    getOptions: () => FileUploaderOptions | void;

                      method onDragLeave

                      onDragLeave: (event: MouseEvent) => void;

                        method onDragOver

                        onDragOver: (event: MouseEvent) => void;

                          method onDrop

                          onDrop: (event: MouseEvent) => void;

                            class FileItem

                            class FileItem {}

                              constructor

                              constructor(uploader: FileUploader, some: File, options: FileUploaderOptions);

                                property alias

                                alias?: string;

                                  property file

                                  file: FileLikeObject;

                                    property formData

                                    formData: any;

                                      property headers

                                      headers: any;

                                        property index

                                        index?: number;

                                          property isCancel

                                          isCancel: boolean;

                                            property isError

                                            isError: boolean;

                                              property isReady

                                              isReady: boolean;

                                                property isSuccess

                                                isSuccess: boolean;

                                                  property isUploaded

                                                  isUploaded: boolean;

                                                    property isUploading

                                                    isUploading: boolean;

                                                      property method

                                                      method?: string;

                                                        property options

                                                        protected options: FileUploaderOptions;

                                                          property progress

                                                          progress: number;

                                                            property some

                                                            protected some: File;

                                                              property uploader

                                                              protected uploader: FileUploader;

                                                                property url

                                                                url: string;

                                                                  property withCredentials

                                                                  withCredentials: boolean;

                                                                    method cancel

                                                                    cancel: () => void;

                                                                      method onBeforeUpload

                                                                      onBeforeUpload: () => void;

                                                                        method onBuildForm

                                                                        onBuildForm: (form: any) => any;

                                                                          method onCancel

                                                                          onCancel: (
                                                                          response: string,
                                                                          status: number,
                                                                          headers: ParsedResponseHeaders
                                                                          ) => any;

                                                                            method onComplete

                                                                            onComplete: (
                                                                            response: string,
                                                                            status: number,
                                                                            headers: ParsedResponseHeaders
                                                                            ) => any;

                                                                              method onError

                                                                              onError: (
                                                                              response: string,
                                                                              status: number,
                                                                              headers: ParsedResponseHeaders
                                                                              ) => any;

                                                                                method onProgress

                                                                                onProgress: (progress: number) => any;

                                                                                  method onSuccess

                                                                                  onSuccess: (
                                                                                  response: string,
                                                                                  status: number,
                                                                                  headers: ParsedResponseHeaders
                                                                                  ) => any;

                                                                                    method remove

                                                                                    remove: () => void;

                                                                                      method upload

                                                                                      upload: () => void;

                                                                                        class FileLikeObject

                                                                                        class FileLikeObject {}

                                                                                          constructor

                                                                                          constructor(fileOrInput: File | HTMLInputElement);

                                                                                            property lastModifiedDate

                                                                                            lastModifiedDate: any;

                                                                                              property name

                                                                                              name?: string;

                                                                                                property rawFile

                                                                                                rawFile: File | HTMLInputElement;

                                                                                                  property size

                                                                                                  size: any;

                                                                                                    property type

                                                                                                    type?: string;

                                                                                                      class FileSelectDirective

                                                                                                      class FileSelectDirective {}

                                                                                                        constructor

                                                                                                        constructor(element: ElementRef);

                                                                                                          property element

                                                                                                          protected element: ElementRef;

                                                                                                            property onFileSelected

                                                                                                            onFileSelected: EventEmitter<File[]>;

                                                                                                              property ɵdir

                                                                                                              static ɵdir: i0.ɵɵDirectiveDeclaration<
                                                                                                              FileSelectDirective,
                                                                                                              '[ng2FileSelect]',
                                                                                                              never,
                                                                                                              { uploader: { alias: 'uploader'; required: false } },
                                                                                                              { onFileSelected: 'onFileSelected' },
                                                                                                              never,
                                                                                                              never,
                                                                                                              false,
                                                                                                              never
                                                                                                              >;

                                                                                                                property ɵfac

                                                                                                                static ɵfac: i0.ɵɵFactoryDeclaration<FileSelectDirective, never>;

                                                                                                                  property uploader

                                                                                                                  uploader?: FileUploader;

                                                                                                                    method getFilters

                                                                                                                    getFilters: () => string;

                                                                                                                      method getOptions

                                                                                                                      getOptions: () => FileUploaderOptions | undefined;

                                                                                                                        method isEmptyAfterSelection

                                                                                                                        isEmptyAfterSelection: () => boolean;

                                                                                                                          method onChange

                                                                                                                          onChange: () => void;

                                                                                                                            class FileUploader

                                                                                                                            class FileUploader {}

                                                                                                                              constructor

                                                                                                                              constructor(options: FileUploaderOptions);

                                                                                                                                property authToken

                                                                                                                                authToken?: string;

                                                                                                                                  property authTokenHeader

                                                                                                                                  authTokenHeader?: string;

                                                                                                                                    property autoUpload

                                                                                                                                    autoUpload: any;

                                                                                                                                      property isUploading

                                                                                                                                      isUploading: boolean;

                                                                                                                                        property options

                                                                                                                                        options: FileUploaderOptions;

                                                                                                                                          property progress

                                                                                                                                          progress: number;

                                                                                                                                            property queue

                                                                                                                                            queue: FileItem[];

                                                                                                                                              property response

                                                                                                                                              response: EventEmitter<any>;

                                                                                                                                                method addToQueue

                                                                                                                                                addToQueue: (
                                                                                                                                                files: File[],
                                                                                                                                                _options?: FileUploaderOptions,
                                                                                                                                                filters?: [] | string
                                                                                                                                                ) => void;

                                                                                                                                                  method cancelAll

                                                                                                                                                  cancelAll: () => void;

                                                                                                                                                    method cancelItem

                                                                                                                                                    cancelItem: (value: FileItem) => void;

                                                                                                                                                      method clearQueue

                                                                                                                                                      clearQueue: () => void;

                                                                                                                                                        method getIndexOfItem

                                                                                                                                                        getIndexOfItem: (value: any) => number;

                                                                                                                                                          method getNotUploadedItems

                                                                                                                                                          getNotUploadedItems: () => any[];

                                                                                                                                                            method getReadyItems

                                                                                                                                                            getReadyItems: () => any[];

                                                                                                                                                              method isFile

                                                                                                                                                              isFile: (value: any) => boolean;

                                                                                                                                                                method isFileLikeObject

                                                                                                                                                                isFileLikeObject: (value: any) => boolean;

                                                                                                                                                                  method onAfterAddingAll

                                                                                                                                                                  onAfterAddingAll: (fileItems: any) => any;

                                                                                                                                                                    method onAfterAddingFile

                                                                                                                                                                    onAfterAddingFile: (fileItem: FileItem) => any;

                                                                                                                                                                      method onBeforeUploadItem

                                                                                                                                                                      onBeforeUploadItem: (fileItem: FileItem) => any;

                                                                                                                                                                        method onBuildItemForm

                                                                                                                                                                        onBuildItemForm: (fileItem: FileItem, form: any) => any;

                                                                                                                                                                          method onCancelItem

                                                                                                                                                                          onCancelItem: (
                                                                                                                                                                          item: FileItem,
                                                                                                                                                                          response: string,
                                                                                                                                                                          status: number,
                                                                                                                                                                          headers: ParsedResponseHeaders
                                                                                                                                                                          ) => any;

                                                                                                                                                                            method onCompleteAll

                                                                                                                                                                            onCompleteAll: () => any;

                                                                                                                                                                              method onCompleteItem

                                                                                                                                                                              onCompleteItem: (
                                                                                                                                                                              item: FileItem,
                                                                                                                                                                              response: string,
                                                                                                                                                                              status: number,
                                                                                                                                                                              headers: ParsedResponseHeaders
                                                                                                                                                                              ) => any;

                                                                                                                                                                                method onErrorItem

                                                                                                                                                                                onErrorItem: (
                                                                                                                                                                                item: FileItem,
                                                                                                                                                                                response: string,
                                                                                                                                                                                status: number,
                                                                                                                                                                                headers: ParsedResponseHeaders
                                                                                                                                                                                ) => any;

                                                                                                                                                                                  method onProgressAll

                                                                                                                                                                                  onProgressAll: (progress: any) => any;

                                                                                                                                                                                    method onProgressItem

                                                                                                                                                                                    onProgressItem: (fileItem: FileItem, progress: any) => any;

                                                                                                                                                                                      method onSuccessItem

                                                                                                                                                                                      onSuccessItem: (
                                                                                                                                                                                      item: FileItem,
                                                                                                                                                                                      response: string,
                                                                                                                                                                                      status: number,
                                                                                                                                                                                      headers: ParsedResponseHeaders
                                                                                                                                                                                      ) => any;

                                                                                                                                                                                        method onWhenAddingFileFailed

                                                                                                                                                                                        onWhenAddingFileFailed: (item: FileLikeObject, filter: any, options: any) => any;

                                                                                                                                                                                          method removeFromQueue

                                                                                                                                                                                          removeFromQueue: (value: FileItem) => void;

                                                                                                                                                                                            method setOptions

                                                                                                                                                                                            setOptions: (options: FileUploaderOptions) => void;

                                                                                                                                                                                              method uploadAll

                                                                                                                                                                                              uploadAll: () => void;

                                                                                                                                                                                                method uploadItem

                                                                                                                                                                                                uploadItem: (value: FileItem) => void;

                                                                                                                                                                                                  class FileUploadModule

                                                                                                                                                                                                  class FileUploadModule {}

                                                                                                                                                                                                    property ɵfac

                                                                                                                                                                                                    static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadModule, never>;

                                                                                                                                                                                                      property ɵinj

                                                                                                                                                                                                      static ɵinj: i0.ɵɵInjectorDeclaration<FileUploadModule>;

                                                                                                                                                                                                        property ɵmod

                                                                                                                                                                                                        static ɵmod: i0.ɵɵNgModuleDeclaration<
                                                                                                                                                                                                        FileUploadModule,
                                                                                                                                                                                                        [typeof i1.FileDropDirective, typeof i2.FileSelectDirective],
                                                                                                                                                                                                        [any],
                                                                                                                                                                                                        [typeof i1.FileDropDirective, typeof i2.FileSelectDirective]
                                                                                                                                                                                                        >;

                                                                                                                                                                                                          Interfaces

                                                                                                                                                                                                          interface FileUploaderOptions

                                                                                                                                                                                                          interface FileUploaderOptions {}

                                                                                                                                                                                                            property additionalParameter

                                                                                                                                                                                                            additionalParameter?: {
                                                                                                                                                                                                            [key: string]: any;
                                                                                                                                                                                                            };

                                                                                                                                                                                                              property allowedFileType

                                                                                                                                                                                                              allowedFileType?: string[];

                                                                                                                                                                                                                property allowedMimeType

                                                                                                                                                                                                                allowedMimeType?: string[];

                                                                                                                                                                                                                  property authToken

                                                                                                                                                                                                                  authToken?: string;

                                                                                                                                                                                                                    property authTokenHeader

                                                                                                                                                                                                                    authTokenHeader?: string;

                                                                                                                                                                                                                      property autoUpload

                                                                                                                                                                                                                      autoUpload?: boolean;

                                                                                                                                                                                                                        property disableMultipart

                                                                                                                                                                                                                        disableMultipart?: boolean;

                                                                                                                                                                                                                          property filters

                                                                                                                                                                                                                          filters?: FilterFunction[];

                                                                                                                                                                                                                            property formatDataFunction

                                                                                                                                                                                                                            formatDataFunction?: Function;

                                                                                                                                                                                                                              property formatDataFunctionIsAsync

                                                                                                                                                                                                                              formatDataFunctionIsAsync?: boolean;

                                                                                                                                                                                                                                property headers

                                                                                                                                                                                                                                headers?: Headers[];

                                                                                                                                                                                                                                  property isHTML5

                                                                                                                                                                                                                                  isHTML5?: boolean;

                                                                                                                                                                                                                                    property itemAlias

                                                                                                                                                                                                                                    itemAlias?: string;

                                                                                                                                                                                                                                      property maxFileSize

                                                                                                                                                                                                                                      maxFileSize?: number;

                                                                                                                                                                                                                                        property method

                                                                                                                                                                                                                                        method?: string;

                                                                                                                                                                                                                                          property parametersBeforeFiles

                                                                                                                                                                                                                                          parametersBeforeFiles?: boolean;

                                                                                                                                                                                                                                            property queueLimit

                                                                                                                                                                                                                                            queueLimit?: number;

                                                                                                                                                                                                                                              property removeAfterUpload

                                                                                                                                                                                                                                              removeAfterUpload?: boolean;

                                                                                                                                                                                                                                                property url

                                                                                                                                                                                                                                                url: string;

                                                                                                                                                                                                                                                  interface FilterFunction

                                                                                                                                                                                                                                                  interface FilterFunction {}

                                                                                                                                                                                                                                                    property name

                                                                                                                                                                                                                                                    name: string;

                                                                                                                                                                                                                                                      method fn

                                                                                                                                                                                                                                                      fn: (item: FileLikeObject, options?: FileUploaderOptions) => boolean;

                                                                                                                                                                                                                                                        interface Headers

                                                                                                                                                                                                                                                        interface Headers {}

                                                                                                                                                                                                                                                          property name

                                                                                                                                                                                                                                                          name: string;

                                                                                                                                                                                                                                                            property value

                                                                                                                                                                                                                                                            value: string;

                                                                                                                                                                                                                                                              interface ParsedResponseHeaders

                                                                                                                                                                                                                                                              interface ParsedResponseHeaders {}

                                                                                                                                                                                                                                                                index signature

                                                                                                                                                                                                                                                                [headerFieldName: string]: string;

                                                                                                                                                                                                                                                                  Package Files (7)

                                                                                                                                                                                                                                                                  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/ng2-file-upload.

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