Using ASIHTTPRequest to upload a file using Cocoa / MacRuby
I'm still trying to get a handle on Cocoa (in both Obj-C and MacRuby) and I am very grateful for how to load the file with ASIHTTPRequest (or without) and MacRuby. Ideally I would like to show the progress in a progress bar.
Must use Cocoa's method to load as open-uri in MacRuby is borken.
Thanks for your help.
a source to share
Here's an example app that does exactly that using HotCocoa: http://github.com/richkilmer/hotcocoa/tree/master/examples/download_and_progress_indicator
You will have to convert it to normal Cocoa, but if you look at http://github.com/richkilmer/hotcocoa/blob/master/examples/download_and_progress_indicator/lib/application.rb you will see the basic callbacks.
You might want to ask your questions on the MacRuby mailing list to help people involved in the project.
- Matt
ps: Cocoa IO methods are more stable and efficient than Ruby. Also keep in mind that you want to make asynchronous calls, something net / http won't help you.
a source to share
Here's more explanation and an example from a book I'm writing: http://macruby.labs.oreilly.com/ch03.html#_urls_requests_connections Hope this helps.
a source to share