Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信多媒体文件没有后缀名时下载失败 #300

Closed
xiaohe27 opened this issue Aug 2, 2017 · 3 comments
Closed

微信多媒体文件没有后缀名时下载失败 #300

xiaohe27 opened this issue Aug 2, 2017 · 3 comments
Labels

Comments

@xiaohe27
Copy link

xiaohe27 commented Aug 2, 2017

对于用户发给企业微信的语音消息,在下载时得到的是一个没有后缀名的文件,文件名默认是“voice”。
这导致了wxCpService.mediaDownload(media_id) 这个默认的下载多媒体文件的接口抛出异常。

ApacheMediaDownloadRequestExecutor.java
文件中

  String fileName = getFileName(response);
  if (StringUtils.isBlank(fileName)) {
    return null;
  }

  String[] nameAndExt = fileName.split("\\.");
  return FileUtils.createTmpFile(inputStream, nameAndExt[0], nameAndExt[1], super.tmpDirFile);

会抛出ArrayIndexOfBoundsException

@xiaohe27
Copy link
Author

xiaohe27 commented Aug 2, 2017

@binarywang

@binarywang
Copy link
Owner

看起来确实是个问题,稍后修复下

@binarywang
Copy link
Owner

临时测试版本2.7.8.BETA已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants