質問するログイン新規登録

回答編集履歴

1

修正

2017/04/25 14:36

投稿

s8_chu
s8_chu

スコア14731

answer CHANGED
@@ -11,12 +11,11 @@
11
11
  $mime = finfo_file($fileinfo, $filepath);
12
12
  if (in_array($mime, $mimelist, true)) {
13
13
  $image = file_get_contents($filepath);
14
- return "data:image/jpg;base64," . base64_encode($image);
14
+ return "data:" . $mime . ";base64," . base64_encode($image);
15
15
  }
16
16
  }
17
17
  return false;
18
18
  }
19
-
20
19
  ?>
21
20
  <!DOCTYPE html>
22
21
  <html lang="ja">