question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No support for Multiple files.

See original GitHub issue

If we have a requirement for multiple images upload this seems to fail.

//TODO--add
 @Input() fileIndex = 0;
//TODO--update
 private onChangesInputImage(changes: SimpleChanges): void {
    if (changes.imageChangedEvent || changes.imageURL || changes.imageBase64 || changes.imageFile) {
      this.reset();
    }
    if (changes.imageChangedEvent && this.isValidImageChangedEvent()) {
      this.loadImageFile(this.imageChangedEvent.target.files[fileIndex]);
    }
    if (changes.imageURL && this.imageURL) {
      this.loadImageFromURL(this.imageURL);
    }
    if (changes.imageBase64 && this.imageBase64) {
      this.loadBase64Image(this.imageBase64);
    }
    if (changes.imageFile && this.imageFile) {
      this.loadImageFile(this.imageFile);
    }
  }

```Just a suggestion.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Mawi137commented, Dec 17, 2020

The cropper takes imageChangedEvent, imageURL, imageBase64 or imageFile as input. As you can see in the code you posted, when you set the imageChangedEvent input, loadImageFile will be called with this.imageChangedEvent.target.files[0]. When you set the imageFile input, it will be called with this.imageFile. So, if you want to show a cropper for each file, you can take your imageChangedEvent.target.files and loop over them, like you probably already do to know how many files there are. Then pass the file to the image cropper via the imageFile input and voila:

<image-cropper
  *ngFor="let file of imageChangedEvent.target.files"
  [imageFile]="file"
  ...
></image-cropper>
1reaction
Mawi137commented, Dec 16, 2020

You can also process the image change event yourself and use the imageFile input to pass the image. That’s what happens within the image cropper as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows 10 - Unable to select multiple files.
Hi all. On occasions (at random) my PC decides not to allow me to select multiple files - as in no CTRL and...
Read more >
Multiple file upload not supported - HCL support
The Commerce Struts 2 implementation does not support multiple file uploads via the same form on a page.
Read more >
enable multiple file support? · Issue #254 - GitHub
@BigstickCarpet - the idea is to allow an undefined number of files to upload. You can set several individual parameters but that's not...
Read more >
This site attempted to download multiple files automatically ...
When trying to download files from the Downloads tab, you get the message "This site attempted to download multiple files automatically" and no...
Read more >
Known Limitations for Multiple Files - Box Support
There are a few limitations for multiple files in one signature request. Consult the list below before sending your first signature request.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found