You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.
I have created an filter on a FSCollection and used context based validation to achieve an error message based on a wrong file type. Is there an way to publish an error message from the onInvalid function, and would It be possible to add an example to the project README?
Files = new FS.Collection("files", {
stores: [new FS.Store.GridFS("filesStore")]
});
var myFilter = {
maxSize: 2000000, // in bytes
allow: {
contentTypes: ['image/*'], //allow only images in this FS.Collection
extensions: ['png']
},
onInvalid: function (message) {
SimpleSchema.messages({fileError: "File Error!"});
Context1.addInvalidKeys([{name: "fileId", type: "fileError"}]);
}
};
Files.filters(myFilter);
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have created an filter on a FSCollection and used context based validation to achieve an error message based on a wrong file type. Is there an way to publish an error message from the onInvalid function, and would It be possible to add an example to the project README?
Files = new FS.Collection("files", { stores: [new FS.Store.GridFS("filesStore")] });
var myFilter = {
maxSize: 2000000, // in bytes
allow: {
contentTypes: ['image/*'], //allow only images in this FS.Collection
extensions: ['png']
},
onInvalid: function (message) {
SimpleSchema.messages({fileError: "File Error!"});
Context1.addInvalidKeys([{name: "fileId", type: "fileError"}]);
}
};
Files.filters(myFilter);
The text was updated successfully, but these errors were encountered: