Skip to content

Commit

Permalink
暫時還是先用加上大寫副檔名的方式
Browse files Browse the repository at this point in the history
大寫轉小寫時暫存檔會發生 '.' 被吃掉的問題 .../5a291cfd23cae.JPGpdf
  • Loading branch information
sunnyworm authored Jan 12, 2018
1 parent 0015967 commit 7f07fbd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/OfficeConverter/OfficeConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ protected function setup($tempPath, $bin)
//extension
$extension = pathinfo($this->file, PATHINFO_EXTENSION);

$extension = strtolower($extension);
//Check for valid input file extension
if (!array_key_exists($extension, $this->getAllowedConverter())) {
throw new OfficeConverterException('Input file extension not supported -- '.$extension);
Expand Down Expand Up @@ -156,6 +155,19 @@ private function getAllowedConverter($extension = null)
'png' => ['pdf'],
'jpg' => ['pdf'],
'jpeg' => ['pdf'],
'PPTX' => ['pdf'],
'PPT' => ['pdf'],
'PDF' => ['pdf'],
'DOCX' => ['pdf', 'odt', 'html'],
'DOC' => ['pdf', 'odt', 'html'],
'DOTX' => ['pdf', 'odt', 'html'],
'DOT' => ['pdf', 'odt', 'html'],
'ODT' => ['pdf', 'html'],
'XLSX' => ['pdf'],
'XLS' => ['pdf'],
'PNG' => ['pdf'],
'JPG' => ['pdf'],
'JPEG' => ['pdf'],
];

if ($extension !== null) {
Expand Down

0 comments on commit 7f07fbd

Please sign in to comment.