Skip to content

Commit

Permalink
提交 (#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
shoaly authored and overtrue committed Dec 6, 2016
1 parent 5676539 commit 15aea1f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Material/Temporary.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function upload($type, $path)
throw new InvalidArgumentException("Unsupported media type: '{$type}'");
}

return $this->parseJSON('upload', [self::API_UPLOAD, ['media' => $path], ['type' => $type]]);
return $this->parseJSON('upload', [self::API_UPLOAD, ['media' => $path], [], ['type' => $type]]);
}

/**
Expand Down
25 changes: 25 additions & 0 deletions src/Support/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,31 @@ class File
'image/png' => '.png',
'image/tiff' => '.tiff',
'image/jpeg' => '.jpg',

// 列举更多的文件 mime, 企业号是支持的, 公众平台这边之后万一也更新了呢
"application/msword"=>".doc",

"application/vnd.openxmlformats-officedocument.wordprocessingml.document"=>".docx",
"application/vnd.openxmlformats-officedocument.wordprocessingml.template"=>".dotx",
"application/vnd.ms-word.document.macroEnabled.12"=>".docm",
"application/vnd.ms-word.template.macroEnabled.12"=>".dotm",

"application/vnd.ms-excel"=>".xls",

"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"=>".xlsx",
"application/vnd.openxmlformats-officedocument.spreadsheetml.template"=>".xltx",
"application/vnd.ms-excel.sheet.macroEnabled.12"=>".xlsm",
"application/vnd.ms-excel.template.macroEnabled.12"=>".xltm",
"application/vnd.ms-excel.addin.macroEnabled.12"=>".xlam",
"application/vnd.ms-excel.sheet.binary.macroEnabled.12"=>".xlsb",

"application/vnd.ms-powerpoint"=>".ppt",

"application/vnd.openxmlformats-officedocument.presentationml.presentation"=>".pptx",
"application/vnd.openxmlformats-officedocument.presentationml.template"=>".potx",
"application/vnd.openxmlformats-officedocument.presentationml.slideshow"=>".ppsx",
"application/vnd.ms-powerpoint.addin.macroEnabled.12"=>".ppam",

];

/**
Expand Down

0 comments on commit 15aea1f

Please sign in to comment.