@rr2/file-upload

Note: This package should be used together with backend package: rokandmat/photo-manipulator from https://bitbucket.org/rokmat/photo-manipulator

Usage no npm install needed!

<script type="module">
  import rr2FileUpload from 'https://cdn.skypack.dev/@rr2/file-upload';
</script>

README

Note: This package should be used together with backend package: rokandmat/photo-manipulator from https://bitbucket.org/rokmat/photo-manipulator

Installation:

  1. Run npm install @rr2/file-upload
  2. In your laravel backend: composer require rokandmat/photo-manipulator
  3. Follow rokandmat/photo-manipulator README.md installation instructions
  4. 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