{"_id":"@augwit/ng2-file-upload","name":"@augwit/ng2-file-upload","dist-tags":{"next":"6.0.0","latest":"6.0.0"},"versions":{"6.0.0":{"name":"@augwit/ng2-file-upload","version":"6.0.0","description":"Angular file uploader","author":{"name":"Dmitriy Shekhovtsov","email":"valorkin@gmail.com"},"license":"MIT","peerDependencies":{"@angular/core":"^16.0.0 || ^17.0.0","@angular/common":"^16.0.0 || ^17.0.0"},"sideEffects":false,"publishConfig":{"registry":"https://registry.npmjs.org/","tag":"next"},"repository":{"type":"git","url":"git+ssh://git@github.com/augwit/ng2-file-upload.git"},"bugs":{"url":"https://github.com/augwit/ng2-file-upload/issues"},"homepage":"https://github.com/augwit/ng2-file-upload#readme","keywords":["angular","upload file","ng","ng2","angular2"],"module":"fesm2022/augwit-ng2-file-upload.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2022":"./esm2022/augwit-ng2-file-upload.mjs","esm":"./esm2022/augwit-ng2-file-upload.mjs","default":"./fesm2022/augwit-ng2-file-upload.mjs"}},"dependencies":{"tslib":"^2.3.0"},"gitHead":"6df2ee8b51fabf6ed964ba37cca5433ac7982b1e","_id":"@augwit/ng2-file-upload@6.0.0","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-MUB+pbcvXM9JSGWlbfp3FEmA3QKSrYP7jH4uN5OIzhRCzmIOz7bCbjvf8oy2Rt8TdwdHVrM68V24g296cusqHQ==","shasum":"ed50c8fef57cf90c37402bb46f5e7ea2af9cf26a","tarball":"https://registry.npmjs.org/@augwit/ng2-file-upload/-/ng2-file-upload-6.0.0.tgz","fileCount":21,"unpackedSize":221256,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGyIAGi2zKz8cjEkk8+u860vwyTH8p98AocgOxe2sULgAiBCaeFWjROuIITgfI5CFvzsJdNstw76tztNMoqhH9lrVg=="}]},"_npmUser":{"name":"iconben","email":"benjamin.qin@gmail.com"},"directories":{},"maintainers":[{"name":"iconben","email":"benjamin.qin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ng2-file-upload_6.0.0_1700560275524_0.6292419051532723"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-21T09:51:15.382Z","6.0.0":"2023-11-21T09:51:15.675Z","modified":"2023-11-21T09:51:15.936Z"},"maintainers":[{"name":"iconben","email":"benjamin.qin@gmail.com"}],"description":"Angular file uploader","homepage":"https://github.com/augwit/ng2-file-upload#readme","keywords":["angular","upload file","ng","ng2","angular2"],"repository":{"type":"git","url":"git+ssh://git@github.com/augwit/ng2-file-upload.git"},"author":{"name":"Dmitriy Shekhovtsov","email":"valorkin@gmail.com"},"bugs":{"url":"https://github.com/augwit/ng2-file-upload/issues"},"license":"MIT","readme":"# ng2-file-upload [![npm version](https://badge.fury.io/js/ng2-file-upload.svg)](http://badge.fury.io/js/ng2-file-upload) [![npm downloads](https://img.shields.io/npm/dm/ng2-file-upload.svg)](https://npmjs.org/ng2-file-upload)\nEasy to use Angular2 directives for files upload ([demo](http://valor-software.github.io/ng2-file-upload/))\n\n[![Angular 2 Style Guide](https://mgechev.github.io/angular2-style-guide/images/badge.svg)](https://github.com/mgechev/angular2-style-guide)\n[![Build Status](https://travis-ci.org/valor-software/ng2-file-upload.svg?branch=development)](https://travis-ci.org/valor-software/ng2-file-upload)\n\n\n## Quick start\n\n1. A recommended way to install ***ng2-file-upload*** is through [npm](https://www.npmjs.com/search?q=ng2-file-upload) package manager using the following command:\n\n  `npm i ng2-file-upload`\n\n  Alternatively, you can [download it in a ZIP file](https://github.com/valor-software/ng2-file-upload/archive/master.zip).\n\n2. Currently `ng2-file-upload` contains two directives: `ng2-file-select` and `ng2-file-drop`. `ng2-file-select` is used for 'file-input' field of form and\n  `ng2-file-drop` is used for area that will be used for dropping of file or files.\n\n3. More information regarding using of ***ng2-file-upload*** is located in\n  [demo](http://valor-software.github.io/ng2-file-upload/) and [demo sources](https://github.com/valor-software/ng2-file-upload/tree/master/demo).\n\n## Using ***ng2-file-upload*** in a project\n\n1. Install as shown in the above section.\n\n2. Import `FileUploadModule` into the module that declares the component using ***ng2-file-upload***:\n\n```import { FileUploadModule } from 'ng2-file-upload';```\n\n3. Add it to `[imports]` under `@NgModule`:\n\n```imports: [ ... FileUploadModule, ... ]```\n\n4. Import `FileUploader` into the component:\n\n```import {  FileUploader } from 'ng2-file-upload';```\n\n5. Create a variable for the API url:\n\n```const URL = 'path_to_api';```\n\n6. Initialize it:\n\n```public uploader:FileUploader = new FileUploader({url: URL}); ```\n\n## API for `ng2FileSelect`\n\n### Properties\n\n  - `uploader` - (`FileUploader`) - uploader object. See using in [demo](https://github.com/valor-software/ng2-file-upload/blob/master/demo/components/file-upload/simple-demo.ts)\n\n### Events\n - `onFileSelected` - fires when files are selected and added to the uploader queue\n\n## API for `ng2FileDrop`\n\n### Properties\n\n  - `uploader` - (`FileUploader`) - uploader object. See using in [demo](https://github.com/valor-software/ng2-file-upload/blob/master/demo/components/file-upload/simple-demo.ts)\n\n  Parameters supported by this object:\n\n  1. `url` - URL of File Uploader's route\n  2. `authToken` - Auth token that will be applied as 'Authorization' header during file send.\n  3. `disableMultipart` - If 'true', disable using a multipart form for file upload and instead stream the file. Some APIs (e.g. Amazon S3) may expect the file to be streamed rather than sent via a form. Defaults to false.\n  4. `itemAlias` - item alias (form name redefinition)\n  5. `formatDataFunction` - Function to modify the request body. 'DisableMultipart' must be 'true' for this function to be called.\n  6. `formatDataFunctionIsAsync` - Informs if the function sent in 'formatDataFunction' is asynchronous. Defaults to false.\n  7. `parametersBeforeFiles` - States if additional parameters should be appended before or after the file. Defaults to false.\n\n### Events\n\n  - `fileOver` - it fires during 'over' and 'out' events for Drop Area; returns `boolean`: `true` if file is over Drop Area, `false` in case of out.\n  See using in [ts demo](https://github.com/valor-software/ng2-file-upload/blob/master/demo/components/file-upload/simple-demo.ts) and\n  [html demo](https://github.com/valor-software/ng2-file-upload/blob/master/demo/components/file-upload/simple-demo.html)\n  - `onFileDrop` - it fires after a file has been dropped on a Drop Area; you can pass in `$event` to get the list of files that were dropped. i.e. `(onFileDrop)=\"dropped($event)\"`\n\n# Troubleshooting\n\nPlease follow these guidelines when reporting bugs and feature requests:\n\n1. Use [GitHub Issues](https://github.com/valor-software/ng2-file-upload/issues) board to report bugs and feature requests (not our email address)\n2. Please **always** write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it.\n\nThanks for understanding!\n\n### License\n\nThe MIT License (see the [LICENSE](https://github.com/valor-software/ng2-file-upload/blob/master/LICENSE) file for the full text)\n","readmeFilename":"README.md"}