"File upload onError,Incorrect content type"在快布洛克斯



我正在尝试在quickblox中上传图像,我已经做过一次了,但现在我收到了这个错误消息。

例如,我的文件是这样的:"/data/user/0/dininiz.tradersmtg/app_Traders MTG Images/Sat Apr 30 20:58:36 GMT-03:00 2016.png"。我测试过,它存在,并且可以很好地获取位图。

当我上传使用:

QBContent.uploadFileTask(imageFile, fileIsPublic, null, new QBEntityCallback<QBFile>()

我收到这个错误:

04-30 20:58:36.979 5634-5634/dinidiniz.tradersmtg W/System.err: com.quickblox.core.exception.QBResponseException: File upload onError,Incorrect content type
04-30 20:58:36.979 5634-5634/dinidiniz.tradersmtg W/System.err:     at com.quickblox.content.task.TaskEntityUploadFile.performTask(TaskEntityUploadFile.java:74)
04-30 20:58:36.979 5634-5634/dinidiniz.tradersmtg W/System.err:     at com.quickblox.content.QBContent.uploadFileTask(QBContent.java:560)
04-30 20:58:36.979 5634-5634/dinidiniz.tradersmtg W/System.err:     at dinidiniz.tradersmtg.activities.ProfileEditActivity.changeAvatar(ProfileEditActivity.java:183)
04-30 20:58:36.979 5634-5634/dinidiniz.tradersmtg W/System.err:     at dinidiniz.tradersmtg.activities.ProfileEditActivity.onActivityResult(ProfileEditActivity.java:166)
04-30 20:58:36.980 5634-5634/dinidiniz.tradersmtg W/System.err:     at android.app.Activity.dispatchActivityResult(Activity.java:6442)
04-30 20:58:36.980 5634-5634/dinidiniz.tradersmtg W/System.err:     at android.app.ActivityThread.deliverResults(ActivityThread.java:3716)
04-30 20:58:36.980 5634-5634/dinidiniz.tradersmtg W/System.err:     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3763)
04-30 20:58:36.980 5634-5634/dinidiniz.tradersmtg W/System.err:     at android.app.ActivityThread.-wrap16(ActivityThread.java)
04-30 20:58:36.980 5634-5634/dinidiniz.tradersmtg W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1403)
04-30 20:58:36.980 5634-5634/dinidiniz.tradersmtg W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
04-30 20:58:36.980 5634-5634/dinidiniz.tradersmtg W/System.err:     at android.os.Looper.loop(Looper.java:148)
04-30 20:58:36.980 5634-5634/dinidiniz.tradersmtg W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5443)
04-30 20:58:36.980 5634-5634/dinidiniz.tradersmtg W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
04-30 20:58:36.980 5634-5634/dinidiniz.tradersmtg W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
04-30 20:58:36.980 5634-5634/dinidiniz.tradersmtg W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

在开始有内容的文件中创建图像后,需要添加"OutPutStream.flush();"。我忘了这句话。

相关内容

  • 没有找到相关文章

最新更新