home icon contact icon rss icon

JSON-P support for Apache upload progress

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 Support

You 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=1234

Would 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=1234

Would 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 :)

Damien Tanner said

Feb 23, 2009 @ 06:42 PM

Very cool.

Zashkaser said

Aug 05, 2009 @ 07:03 PM

Thanks for taking the time to write in. We aim to update out blog at least on a weekly basis.

hotyuew said

Oct 21, 2009 @ 12:27 AM

Такое найти и написать сложно, информация очень полезна для начинающих :)

RSS feed for comments on this post

Leave a Comment