@rr2/file-upload
v1.0.40
Published
**Note:** _This package should be used together with backend package:_ `rokandmat/photo-manipulator` _from_ https://bitbucket.org/rokmat/photo-manipulator
Downloads
66
Readme
Note: This package should be used together with backend package: rokandmat/photo-manipulator
from https://bitbucket.org/rokmat/photo-manipulator
###Installation:
- Run
npm install @rr2/file-upload
- In your laravel backend:
composer require rokandmat/photo-manipulator
- Follow
rokandmat/photo-manipulator
README.md installation instructions - Import file-upload module (see below)
@NgModule({
imports: [
FileUploadModule.forRoot({
photoManipulatorUrl: '<url to photo manipulator>'
}),
...
],
...
})
###Usage:
<app-file-upload
[uiConfig]="{}"
[config]="{}"
(uploadComplete)="handleUploadComplete($event)"
></app-file-upload>
| @Input() uiConfig: FileUploadUiConfigInterface | | | | :---: | :---: | :---: | | previewPerRow | number | Amount of images prev
| @Input() config: FileUploadUiConfigInterface | | | | :---: | :---: | :---: | | return_type | 'id' or 'path' | If 'id' is set it means that images will be saved to database by backend and only saved element ID references will be returned. If 'path is selected' it means that array with images relative paths will be returned, no saving to database done | | onlyImages | boolean | Allow upload other files but images | | directory | string (optional) | Where files should be put after base path. | | filesPerPostChunk | string (optional) | How many files should be sent to backend in one POST request | | prefix | string (optional) | Prefix to add to filename | | suffix | string (optional) | Suffix to add to filename |
| @Output() uploadComplete: FileUpload[] | | | | :---: | :---: | :---: | | paths | object[] | Data where files were saved on server | ... | ... | See FileItem.ts