diff options
Diffstat (limited to 'server')
| -rwxr-xr-x | server/core/Image.php | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/server/core/Image.php b/server/core/Image.php index f8cac04..41eb9d8 100755 --- a/server/core/Image.php +++ b/server/core/Image.php @@ -377,7 +377,7 @@ class image implements Core{ } } } - + /** * Upload an image * @@ -388,9 +388,9 @@ class image implements Core{ */ private function uploadImage(){ $id = $this->app->getPostParam("id"); - $file_name = $_FILES['file']['name']; - $file_error = $_FILES['file']['error']; - $file_tmp = $_FILES['file']['tmp_name']; + $file_name = $_FILES['files']['name']; + $file_error = $_FILES['files']['error']; + $file_tmp = $_FILES['files']['tmp_name']; switch($file_error){ case UPLOAD_ERR_INI_SIZE: @@ -405,10 +405,15 @@ class image implements Core{ return; } if( !is_uploaded_file($file_tmp) ) - { - $this->app->setOutput("Error", "File Upload Error"); - return; - } + { + //$this->app->setOutput("Error", "File Upload Error"); + file_put_contents( + $file_tmp, + fopen("php://input", 'r'), + FILE_APPEND + ); + + } if(!isset($id)){ $this->app->setOutput("Error", "Incorrect id parameter"); |
