1
参考此问题:quickblox web how to upload profile pictureQuickblox消息附件
我想将上传的文件附加到新消息。创建
QB.content.createAndUpload({file: profile_picture, public: true}, function(error, response) {
if (error) {
console.log("upload didn't work");
} else {
var blob_id = response.id;
// Example HERE //
var attachment = {
id: response.id.toString(),
name: response.name,
type: "photo",
url: response.path,
name: response.name,
'content-type': response.content_type
};
QB.chat.message.create({
attachments: [attachment]
},...)
}
});
消息(见下面的照片),但是名称和内容类型的值不被保存到quickblox。下面的照片显示了使用Q-municate应用程序附加的文件,第二个内容来自上面引用的代码。你能否让我知道正确的做法是将附件添加到聊天消息中。由于