-
-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
support callback which will only called once before upload #208
Comments
I'll stay with |
- Documented as `onInitiateUpload` in [Constructor](https://github.com/VeliovGroup/Meteor-Files/wiki/Construct or)
v1.7.2 - Fix #207 - Fix availability of `this.userId` in `onBeforeUpload` hook - `this.userId` now always `null` if user not logged in, previously sometimes it might be `undefined` - Implement #208 : Documented as `onInitiateUpload` in [Constructor](https://github.com/VeliovGroup/Meteor-Files/wiki/Constructor) - Fix mime-type in base64 uploads, thanks to @FinnFrotscher
Implemented in v1.7.2 |
@dr-dimitru It worked, but it seems that the returned value from |
However, I can |
Why not use |
It would be better to make the file validation (check weight and extension for example) in onInitiateUpload instead of onBeforeUpload? Since that runs only once and before starting the upload. |
This will be removed in v2.0 It was done this way to protect unfinished uploads from fraud actions. As previously was no control of uploaded size, currently any size overflow will abort upload. |
I've looked into the code, seems like onInitiateUpload is not being called if onBeforeUpload is not being defined, is this done intentionally? |
@livimonte |
@DrkCoater you right, this shouldn't be this way. |
- Call `onInitiateUpload` even if `onBeforeUpload` is not defined, see [this comment](#208 (comment) ment-301208873), thanks to @DrkCoater
As mentioned in #207, currently, onBeforeUpload will called on each chunk upload, which could raise potential performance drop if some expensive operation is contained in onBeforeUpload. Would be great to support callback which would only execute once, either by change the current onBeforeUpload or add something like onInitiateUpload.
The text was updated successfully, but these errors were encountered: