gpt4 book ai didi

java - Quickblox android 聊天 - 音频附件上传失败

转载 作者:行者123 更新时间:2023-11-30 01:57:08 25 4
gpt4 key购买 nike

我正在尝试使用 quickblox api 上传音频文件。我可以在我的 Nexus 7 中上传音频附件。问题是,当我尝试使用相同的代码在其他可用设备(Asus zenphone 和 Karbonn Android 设备)中上传音频文件时,我收到 quickblox 响应异常。异常(exception)是“content_type 太短(最少 5 个字符),content_type 无效”。请有人帮我解决这个异常(exception)。我在以下 block 中遇到异常。

   /** 
* This method will invoke when user try to upload a file in the chatbox.
*
* @param dialogId
* @param inputFile
* @param messageId
* @return
* @throws Exception
*
**/

public QBFile loadAttachFile(String dialogId, final File inputFile, final String messageId) throws Exception {
QBFile file = null;

try {
file = QBContent.uploadFileTask(inputFile, true, (String) null,
new QBProgressCallback() {

@Override
public void onProgressUpdate(int arg0) {
// TODO Auto-generated method stub

if (!lastUpdatedProgress.contains(arg0)) {
lastUpdatedProgress.add(arg0);
//Here we will update the progress of the progressbar details
updateAttachmentUploadingProgress(messageId, arg0);
}

}
});
} catch (QBResponseException exc) {
throw new Exception(context.getString(R.string.dlg_fail_upload_attach) );
}
return file;
}

最佳答案

这是“acc”文件格式和“android.webkit.MimeTypeMap”类的问题

QuickBlox 已发布带有修复程序的 Android SDK 2.3 版本 http://quickblox.com/developers/Android#Framework_changelog

检查一下

关于java - Quickblox android 聊天 - 音频附件上传失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32051478/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com