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

2.1.X版媒体下载没有扩展名 #252

Closed
yangshenys opened this issue Jan 15, 2016 · 0 comments
Closed

2.1.X版媒体下载没有扩展名 #252

yangshenys opened this issue Jan 15, 2016 · 0 comments

Comments

@yangshenys
Copy link

src/Wechat/Utils/File.php

这里
/**
* 根据文件流获取.
*
* @param string $content 文件流
*
* @return string 文件类型
*/
public static function getStreamExt($content)
{
$finfo = new finfo(FILEINFO_MIME);
$mime = $finfo->buffer($content); //$mime带有charset信息,不符合键值串,可改为如下
// $mime = strstr($finfo->buffer($content), ';', true);
return isset(self::$extensionMap[$mime]) ? self::$extensionMap[$mime] : '';
}

overtrue added a commit that referenced this issue Jan 15, 2016
overtrue added a commit that referenced this issue Jan 15, 2016
overtrue added a commit that referenced this issue Jan 15, 2016
overtrue added a commit that referenced this issue Jan 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants