Skip to content

Commit

Permalink
Fix typecho#334: Support uploading pictures using Windows Live Writer…
Browse files Browse the repository at this point in the history
… or Open Live Writer.
  • Loading branch information
Atom Long committed May 8, 2020
1 parent 029579b commit 408cb56
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions var/Widget/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 408cb56

Please sign in to comment.