How do I upload an image to Twitter?

The website has a webservice API which will post a photo to a user's Twitter account along with a short message. You can use the download manager to upload a file. Even though it is called the download manager it has a method to upload files as well using HTTP POST.

this.controller.serviceRequest('palm://com.palm.downloadmanager/', {
    method: 'upload',
    parameters: {
        'fileName': filename,
        'url': '',
        'contentType': 'image/jpg',
        "postParameters": [
            {"key":"username" , "data": username},
            {"key":"password" , "data": password},
        "subscribe": true 
    onSuccess : function (resp){'Success : ' + Object.toJSON(resp));
    onFailure : function (e){'Failure : ' + Object.toJSON(e));

Learn More