【发布时间】:2014-01-09 11:46:48
【问题描述】:
我需要向我的用户添加一张照片,通过从 Web 界面执行此操作,我将照片设置为一个名为 photo 的字段,但如果我尝试从移动应用程序以编程方式执行相同的操作,它不会不行。
photonativePath 是我在相机或图库中的照片网址。
Cloud.Users.update({
email: 'joeuser@mycompany.com',
first_name: 'joe',
last_name: 'user',
photo : Titanium.Filesystem.getFile(photonativePath),
custom_fields: {
favorite_color: 'blue',
age: 25
}
}, function (e) {
if (e.success) {
var user = e.users[0];
alert('Success:\n' +
'id: ' + user.id + '\n' +
'first name: ' + user.first_name + '\n' +
'last name: ' + user.last_name);
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
【问题讨论】:
-
你遇到了什么错误?
-
还有photonativePath的值是什么
-
photonativePath 是我来自相机或画廊的照片网址。
标签: titanium appcelerator titanium-mobile acs