diff --git a/README.md b/README.md index a422bdf..b85c925 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,63 @@ Easy to use Angular2 directives for files upload ([demo](http://valor-software.g ```public uploader:FileUploader = new FileUploader({url: URL}); ``` +## Using ***ng2-file-upload*** with multiple uploads and other parameters +To add extra information (i.e. title, description) when uploading multiple files: + +In your template: +``` + + {{ item?.file?.name }} + + **** + **** + {{ item?.file?.size/1024/1024 | number:'.2' }} MB + +
+
+
+ + + + + + + + + + + + + +``` +You can add inputs outside of a form, and use ```[(ngModel)]``` to add keys to the ```item``` object. + +``` + **** + **** +``` +Inside your upload component, add the following: + +``` + this.uploader.onBuildItemForm = (item, form) => { + form.append('title', item.formData.title); + form.append('description', item.formData.description); + console.log(item); + }; + +``` +If you are using `Node.js` with `multer`, the extra information will not show up in the `req.files` object. You will have to pull the data from the `req.body` object. + + ## API for `ng2FileSelect` ### Properties