I am dropping file and using button to upload file but no event fires and the buttons "Upload All", "Cancel all", "Remove all" remain disabled. #1087
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi I am trying to make it work but nothing is happening. I have already uninstalled and then installed the package again. I have gone through the code but nothing is happening.
This is code for photo-editor.component.html
`
This is for its ts
`import { Component, Input, OnInit } from '@angular/core';
import { FileUploader } from 'ng2-file-upload';
import { Photo } from 'src/app/_models/Photo';
import { environment } from 'src/environments/environment';
import { AuthService } from 'src/app/_services/auth.service';
import { UserService } from 'src/app/_services/user.service';
import { AlertifyService } from 'src/app/_services/alertify.service';
@Component({
selector: 'app-photo-editor',
templateUrl: './photo-editor.component.html',
styleUrls: ['./photo-editor.component.css']
})
export class PhotoEditorComponent implements OnInit {
@Input() photos: Photo[];
uploader: FileUploader;
hasBaseDropZoneOver = false;
baseUrl = environment.apiUrl;
constructor(private authService: AuthService, private userService: UserService,
private alertify: AlertifyService) { }
ngOnInit() {
this.initializeUploader();
}
fileOverBase(e: any): void {
console.log('file event fired');
this.hasBaseDropZoneOver = e;
}
initializeUploader() {
this.uploader = new FileUploader({
url: this.baseUrl + 'users/' + this.authService.decodedToken.nameid + '/photos',
authToken: 'Bearer ' + localStorage.getItem('token'),
isHTML5: true,
allowedFileType: ['image'],
removeAfterUpload: true,
autoUpload: false,
maxFileSize: 10 * 1024 * 1024
});
}
}
`
Hi,
I am having the same issue. Did you manage to make this work?
Thanks
Hello,
I'm also struggling with this exact problem. Nothing fires. I'm using Angular 6 and have tried every example on the whole interwebs.... I even found one example indicating to install this:
$npm install rxjs-compat --save
Wondering if the project is in decline and we should just move on....
Thanks
We have the same problem, has anyone figured it out ?
Thanks !
I had the issue when I wrongly defined the file extension filter
so you should try to remove : allowedFileType: ['image'],