xhr.open('PUT', this.STORAGE_URL + '/' + container + '/' + filename); 	
xhr.setRequestHeader('X-Auth-Token', this.TOKEN); 
xhr.setRequestHeader('Content-Type', media.getMimeType()); 
xhr.setRequestHeader('Content-Length', media.getLength()); 
	
//we'll set some meta data if the user has passed it
if(meta != null){
   for(var key in meta){
	xhr.setRequestHeader('X-Object-Meta-' + key.toString(), meta[key].toString());  
   }
}
	
xhr.send(media);

/*
--------
error output below, important bit being Content-Length header already present
if i don't set the content-length header the upload will appear to work but will send the wrong content length (always 15 bytes)
--------
*/

W/IdleConnectionHandler(  479): Removing a connection that never existed!
E/TiHttpClient(  479): (TiHttpClient-3) [8,771] HTTP Error (org.apache.http.client.ClientProtocolException): Content-Length header already present
E/TiHttpClient(  479): org.apache.http.client.ClientProtocolException
E/TiHttpClient(  479): 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:557)
E/TiHttpClient(  479): 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:653)
E/TiHttpClient(  479): 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:637)
E/TiHttpClient(  479): 	at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1140)
E/TiHttpClient(  479): 	at java.lang.Thread.run(Thread.java:1019)
E/TiHttpClient(  479): Caused by: org.apache.http.ProtocolException: Content-Length header already present
E/TiHttpClient(  479): 	at org.apache.http.protocol.RequestContent.process(RequestContent.java:70)
E/TiHttpClient(  479): 	at org.apache.http.protocol.BasicHttpProcessor.process(BasicHttpProcessor.java:290)
E/TiHttpClient(  479): 	at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:160)
E/TiHttpClient(  479): 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:401)
E/TiHttpClient(  479): 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
E/TiHttpClient(  479): 	... 4 more
I/TiHttpClient(  479): (TiHttpClient-3) [9,780] Sending error Content-Length header already present
E/TiAPI   (  479): ERROR: [object Object]
D/dalvikvm(  452): GC_EXPLICIT freed 73K, 51% free 2865K/5767K, external 1461K/1740K, paused 66ms