How do I upload an image to Twitter?

The TwitPic.com 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,
        'fileLabel':'media',
        'url': 'http://twitpic.com/api/uploadAndPost',
        'contentType': 'image/jpg',
        "postParameters": [
            {"key":"username" , "data": username},
            {"key":"password" , "data": password},
        ],
        "subscribe": true 
    },
    onSuccess : function (resp){
        Mojo.Log.info('Success : ' + Object.toJSON(resp));
    },
    onFailure : function (e){
        Mojo.Log.info('Failure : ' + Object.toJSON(e));
    }.bind(this)
});

Learn More