需求:将palm手机上的文件上传到Http服务器端
FileuploadAssistant.prototype.uploadHandler = function()
{
this.controller.serviceRequest('palm://com.palm.downloadmanager/',
{
method : 'upload',
parameters :
{
'fileName' : "/media/internal/files/nami.jpg",
'fileLabel' : "myfile",
'url' : 'http://192.168.87.45:8088/WebDemo/uploadFile.do',
'contentType' : 'image/jpeg',
'postParameters' :
[{
key : "username",
data : "synnex",
contentType : "text/plain"
},
{
key : "password",
data : "123456",
contentType : "text/plain"
}],
'subscribe' : true
},
onSuccess : function(resp)
{
Mojo.Log.info('Success : ' + Object.toJSON(resp));
},
onFailure : function(e)
{
Mojo.Log.info('Failure : ' + Object.toJSON(e));
}
});
}
{
this.controller.serviceRequest('palm://com.palm.downloadmanager/',
{
method : 'upload',
parameters :
{
'fileName' : "/media/internal/files/nami.jpg",
'fileLabel' : "myfile",
'url' : 'http://192.168.87.45:8088/WebDemo/uploadFile.do',
'contentType' : 'image/jpeg',
'postParameters' :
[{
key : "username",
data : "synnex",
contentType : "text/plain"
},
{
key : "password",
data : "123456",
contentType : "text/plain"
}],
'subscribe' : true
},
onSuccess : function(resp)
{
Mojo.Log.info('Success : ' + Object.toJSON(resp));
},
onFailure : function(e)
{
Mojo.Log.info('Failure : ' + Object.toJSON(e));
}
});
}