I can see the photo(JPEG) being attached to the CouchDB server when I run
the application (Can see the size (KB) details, but the image does not
open, not readable). Anyone had similar problems? Here is the Android code
snippet written in Titanium Studio.

var image = event.media;
var xhr = Titanium.Network.createHTTPClient();
xhr.open('PUT','http://129.26.160.66:5984/mc/id100/attachment.jpg?rev=42-2fd65cfa04540fb9e73ee85a42111d2e');
xhr.setRequestHeader("Content-Type", "image/jpeg");
xhr.send({media:image});


Regards,

> We do.
>
> On 24 November 2011 15:07, Keith Gable <[email protected]> wrote:
>> Also, Titanium sucks and you can only GET and POST. Rails supports
>> X-HTTP-Method-Override, which permits you to specify the HTTP method
>> when
>> posting, but I don't know about CouchDB. If CouchDB doesn't, you can't
>> use
>> Titanium's HTTPClient to do this.
>> On Nov 24, 2011 8:33 AM, <[email protected]> wrote:
>>
>>> Dear members,
>>>
>>> I am writing an Android application in javascript (Titanium Studio),
>>> this
>>> application uses HTTP to PUT data to the CouchDB server. I am trying to
>>> implement a functionality where image captured from the mobile camera
>>> can
>>> be uploaded to the CouchDB server via the application. How could this
>>> be
>>> done ? Has anyone tried such a functionality?
>>>
>>> Thanks & Best Regards,
>>> Venu.
>>>
>>>
>>
>


Reply via email to