From c7327eabce5336c57d7c9e19735f322f9b5250a0 Mon Sep 17 00:00:00 2001 From: Parziphal Date: Wed, 4 Feb 2015 10:30:19 -0500 Subject: [PATCH] Fixed #136. --- app/models/Post/FileMethods.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/Post/FileMethods.php b/app/models/Post/FileMethods.php index ce436db..8f9d269 100755 --- a/app/models/Post/FileMethods.php +++ b/app/models/Post/FileMethods.php @@ -303,8 +303,12 @@ trait PostFileMethods try { $file = Danbooru::http_get_streaming($this->source); - if ($file) + if ($file) { file_put_contents($this->tempfile_path(), $file); + # This flag will cause Post\ImageStore\Base\move_file() to rename() the file + # instead of move_uploaded_file(). + $this->is_import = true; + } if (preg_match('/^http/', $this->source) && !preg_match('/pixiv\.net/', $this->source)) { # $this->source = "Image board"; $this->source = "";