Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New beforeUpload event - makes it possible to validate files before the upload starts #142

Merged
merged 2 commits into from
Dec 1, 2016

Conversation

eivindr
Copy link
Contributor

@eivindr eivindr commented Dec 1, 2016

Can be used for validating files sizes - see basic example. Can also be used for more advanced size checking (by file extension).

Calling uploadingFile.setAbort() from the event will abort the upload (xhr.send is not called) and the file is removed from the queue.

@jkuri
Copy link
Contributor

jkuri commented Dec 1, 2016

@eivindr thanks alot! can you bump version in package.json also please? then I'll merge and publish to npm.

@jkuri jkuri merged commit f9c6cc0 into bleenco:master Dec 1, 2016
@jkuri
Copy link
Contributor

jkuri commented Dec 1, 2016

Thanks, published 1.5.4 to npm.

@inigopascall
Copy link

Trying to use this function as per the example I am getting Type 'EventEmitter<{}>' is not assignable to type EventEmitter<uploadedFile>" Type '{}' is not assignable to type 'UploadedFile' Property 'id' is missing in type '{}' during the build process

@inigopascall
Copy link

Going into node_modules/ng2-uploader/src/services/ng2-uploader.ts and changing line 87 from _beforeEmitter: EventEmitter<UploadedFile> = new EventEmitter();

to

_beforeEmitter: EventEmitter<any> = new EventEmitter();

Fixes the problem for now.

@jkuri
Copy link
Contributor

jkuri commented Dec 4, 2016

thanks, 0d4433a and published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants