Skip to content

Instantly share code, notes, and snippets.

@gmarik
Created December 5, 2010 21:25
Show Gist options
  • Save gmarik/729481 to your computer and use it in GitHub Desktop.
Save gmarik/729481 to your computer and use it in GitHub Desktop.
bills = [
{:name=>"bill[attachment]",
:filename=>"/data/data/com.rhomobile.imageupload/rhodata/apps/rhoconfig.txt"},
{:name=>"bill[amount]",
:body=>nil}]
Rho::AsyncHttp.upload_file(
:url => 'http://localhost:3000/bills.json',
:callback => url_for(:action => :push_callback),
:multipart => bills)
# the problem is probaly here: https://github.com/rhomobile/rhodes/blob/59c19e246b5df732d9c9269648f366a0c5912e26/platform/shared/net/AsyncHttp.cpp#L138
# Zero length body makes rhodes switch to else case and set content-type.
# I believe it has to be all the other way:
#If (file)
# set content type
# else # means body
# blank content type
# end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment