From 408cb56ce1a5683443e65ca0e80558e4de56f9fa Mon Sep 17 00:00:00 2001 From: Atom Long Date: Sat, 9 May 2020 00:20:50 +0800 Subject: [PATCH] Fix #334: Support uploading pictures using Windows Live Writer or Open Live Writer. --- var/Widget/Upload.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/var/Widget/Upload.php b/var/Widget/Upload.php index ce9c9f2efe..ee578665f9 100644 --- a/var/Widget/Upload.php +++ b/var/Widget/Upload.php @@ -126,6 +126,12 @@ public static function uploadHandle($file) if (!file_put_contents($path, $file['bytes'])) { return false; } + } else if (isset($file['bits'])) { + + //直接写入文件 + if (!file_put_contents($path, $file['bits'])) { + return false; + } } else { return false; } @@ -197,6 +203,14 @@ public static function modifyHandle($content, $file) if (!file_put_contents($path, $file['bytes'])) { return false; } + } else if (isset($file['bits'])) { + + @unlink($path); + + //直接写入文件 + if (!file_put_contents($path, $file['bits'])) { + return false; + } } else { return false; }