Single File Upload Documentation #921

Open
opened 2017-11-02 18:38:49 +00:00 by Joshua-Cummings · 3 comments
Joshua-Cummings commented 2017-11-02 18:38:49 +00:00 (Migrated from github.com)

I don't see any documentation as to the best way to upload only a single file.

I have a use case where I need to only allow the user to upload a single file.
(i.e. selecting another file should replace the current file rather than append it to the upload queue)
Seems like a common use case but I can't seem to find any documentation on this.

Any guidance on this would be appreciated.

I don't see any documentation as to the best way to upload only a single file. I have a use case where I need to only allow the user to upload a single file. (i.e. selecting another file should replace the current file rather than append it to the upload queue) Seems like a common use case but I can't seem to find any documentation on this. Any guidance on this would be appreciated.
BugKiller-tech commented 2017-11-15 02:46:59 +00:00 (Migrated from github.com)

I have same problem.
I want to upload only one file for profile updating feature.

I have same problem. I want to upload only one file for profile updating feature.
Joshua-Cummings commented 2017-11-15 03:14:32 +00:00 (Migrated from github.com)

I am currently using onAfterAddingFile in my ngOnInit to get the functionality I need:

this.uploader.onAfterAddingFile = f => {
  if (this.uploader.queue.length > 1) {
    this.uploader.removeFromQueue(this.uploader.queue[0]);
  }
};

Not sure if this is the best method to limit single files but it works for my needs.

I am currently using `onAfterAddingFile` in my `ngOnInit` to get the functionality I need: ``` this.uploader.onAfterAddingFile = f => { if (this.uploader.queue.length > 1) { this.uploader.removeFromQueue(this.uploader.queue[0]); } }; ``` Not sure if this is the best method to limit single files but it works for my needs.
cmckni3 commented 2017-12-04 06:18:26 +00:00 (Migrated from github.com)

Does queueLimit work for this?

There's also this

Does `queueLimit` work for this? There's also [this](https://github.com/valor-software/ng2-file-upload/issues/892#issuecomment-333449712)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#921