Immediately start uploading after the file select #219

Open
opened 2016-05-24 13:56:25 +00:00 by ammar91 · 7 comments
ammar91 commented 2016-05-24 13:56:25 +00:00 (Migrated from github.com)

Is there a way to instruct it to immediately start uploading after file select? I have to manually trigger the upload method by doing uploader.queue[0].upload on the click of another button.

Is there a way to instruct it to immediately start uploading after file select? I have to manually trigger the upload method by doing `uploader.queue[0].upload` on the click of another button.
fojt commented 2016-05-24 13:58:01 +00:00 (Migrated from github.com)
https://github.com/valor-software/ng2-file-upload/blob/development/components/file-upload/file-uploader.class.ts#L17
ammar91 commented 2016-05-24 14:03:23 +00:00 (Migrated from github.com)

Thanks so much.
BTW, sorry for the stupid question. Didn't realize it was that easy.

Thanks so much. BTW, sorry for the stupid question. Didn't realize it was that easy.
bernardopacheco commented 2016-06-10 18:47:58 +00:00 (Migrated from github.com)

@ammar91 I don't think it is a stupid question because it isn't in the documentation. The documentation says that the only possible FileUploader parameters are url and authToken.

@ammar91 I don't think it is a stupid question because it isn't in the documentation. The documentation says that the only possible _FileUploader_ parameters are **url** and **authToken**.
lewisames commented 2016-06-10 18:52:22 +00:00 (Migrated from github.com)

You can use the setOptions method on your instance of the uploader and pass "autoUpload: true", or set the autoUpload property on your instance to true.

You can use the setOptions method on your instance of the uploader and pass "autoUpload: true", or set the autoUpload property on your instance to true.
slavafomin commented 2017-07-01 15:42:41 +00:00 (Migrated from github.com)

We could just bind to the change event of the input[type="file"] element.

<!-- template -->
<input type="file" ng2FileSelect [uploader]="uploader" (change)="onFileSelected()">
// controller
onFileSelected () {
  this.uploader.uploadAll();
}
We could just bind to the `change` event of the `input[type="file"]` element. ```html <!-- template --> <input type="file" ng2FileSelect [uploader]="uploader" (change)="onFileSelected()"> ``` ```typescript // controller onFileSelected () { this.uploader.uploadAll(); } ```
coder-strange commented 2017-11-14 18:59:00 +00:00 (Migrated from github.com)

Why is this issue is still open??

Why is this issue is still open??
No6things commented 2017-12-19 23:15:07 +00:00 (Migrated from github.com)

As @fojt points out in the now, broken link, the FileUploader can receive an autoUpload: boolean attribute to achieve the autoupload.

Note aside, the current README doesn't provide enough documentation and some of the examples are kinda old.

As @fojt points out in the now, broken link, the FileUploader can receive an` autoUpload: boolean` attribute to achieve the autoupload. Note aside, the current README doesn't provide enough documentation and some of the examples are kinda old.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#219