-
Notifications
You must be signed in to change notification settings - Fork 105
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
#32: File constraints now available on both client and server #35
Conversation
…client side validation
|
||
return (Slingshot._directives[name] = | ||
new Slingshot.Directive(service, options)); | ||
new Slingshot.Directive(name, service, options)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this API change can be avoided, if the we mix in the file restrictions into options before constructing the directive.
|
||
var file = _.pick(self.file, "name", "size", "type"); | ||
|
||
status.set("validating"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, this includes the server-request for authorization. I miss-read the diff before and though it was a new status added for the client-side validation step. Lets keep it at "authorizing".
* @param {Object} context | ||
* @param {FileInfo} file | ||
* @param {Object} [meta] | ||
* @param {Function} [authorize] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this param doc.
Great please update the readme also. |
#32: File constraints now available on both client and server
Has this made it to the repo server? The slingshot version I am using doesn't seem to have the |
This was released in 0.3.0. On Thu, 22 Jan 2015 10:48 pm Jose Garcia notifications@github.com wrote:
|
@gsuess I updated to the latest, but validate never returns an error. Is there anyway to debug it further? |
The most likely cause is that you have not declared any |
Proposed api and usage: (haven't updated the docs yet)
File restrictions, can be configured both on the client and server
The directive
The uploader
The validate method is also called right before the authorization request method is called.