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

Enabled (backwards compatable) server callbacks using JSON-RPC 2.0 #492

Closed
wants to merge 2 commits into from
Closed

Conversation

Beanow
Copy link

@Beanow Beanow commented Feb 16, 2012

Since in our system we use plupload to handle uploads and access the files through an ID that the server creates in our database we needed the server callback functionality.

Some features:
Error messages can be returned from the server even if the HTTP request was successful.
It allows for return values from the server when the upload was successful.
It creates a new event called ServerFileIdReport. (Change to a more generic name if you wish, it can be used for any JSON serializable return value.)
Tested and implemented in the HTML5, Flash and HTML4 runtimes. Others can be implemented with ease about 4-5 lines of code. Only reason I didn't implement them is because I had no environment to test it and our system does not require other runtimes in the first place.

@jayarjo
Copy link
Contributor

jayarjo commented Feb 20, 2012

Is there a serious reason for this to be in the core? After all you could always get a response from server in FileUploaded handler and process it in a way you require. No?

@Beanow
Copy link
Author

Beanow commented Feb 20, 2012

This solution offers a consistent way to support server side error handling and response sending without requiring that to be implemented in the FileUploaded event. This is a significant feature because it does not require the implementer of this event listener to have knowledge of server side scripts.

@jayarjo
Copy link
Contributor

jayarjo commented Jul 7, 2013

We do not bind to any specific response format, JSON-RPC is only an example. Although great suggestion for people looking for how to handle errors passed back in JSON-RPC response. That could be a nice example page in our wiki, here on github. But obviously not merging this one into the core.

@jayarjo jayarjo closed this Jul 7, 2013
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.

2 participants