Reputation: 256
I am trying to upload an audio file using quickblox api. I am able to upload audio attachment in my Nexus 7. The issue is, when I try to upload audio files using the same code, in other available devices (Asus zenphone and Karbonn Android one) , I am getting quickblox response exception. The exception is "content_type is too short (minimum is 5 characters),content_type is invalid". Please someone help me with this exception. I am getting exception in the following 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;
}
Upvotes: 1
Views: 722
Reputation: 18346
This was an issue with 'acc' file format and 'android.webkit.MimeTypeMap' class
QuickBlox has released the Android SDK 2.3 version with the fix http://quickblox.com/developers/Android#Framework_changelog
Check it out
Upvotes: 1