Just a quick note about new feature added to apache upload progress and jquery upload progress libs.
Ron Evans aka deadprogrammer has added support for JSON-P in this commit. What does it mean? Cross domain requests are now possible, so if you need such a functionality pull the newest changes.
Here is Ron’s description from README:
- JSON-P SupportYou can also request progress updates by using JSON-P, if you are uploading the file from a different domain or subdomain than the web server that is handling your original request. Adding a “callback=yourCallbackFunction” parameter to your request to the progress server will activate this functionality.
For example, a request like:
http://uploads.yourdomain.com/progress?callback=jsonp123&X-Progress-ID=1234Would return the JSON-P function:
jsonp123(new Object({ ‘state’ : ‘uploading’, ‘received’ : 35587, ‘size’ : 716595, ‘speed’ : 35587 }));The normal JSON request:
http://www.yourdomain.com/progress?X-Progress-ID=1234Would return the JSON data:
new Object({ ‘state’ : ‘uploading’, ‘received’ : 35587, ‘size’ : 716595, ‘speed’ : 35587 })
Remember to update jquery upload progress also, to use jsonp.
Enjoy :)