diff options
| author | Yoggzo <yogg@epsina.com> | 2016-05-08 21:20:15 +0200 |
|---|---|---|
| committer | Yoggzo <yogg@epsina.com> | 2016-05-08 21:20:15 +0200 |
| commit | e10ce91a63c842b0213e6726787663e68e939b88 (patch) | |
| tree | 269a6ba9e142ea6380d38b5d8dd711c1fc2b68c6 | |
| parent | 4bac0804184f7a11eb76b420a2325ce170e24985 (diff) | |
patch Missing parameter file for uploadImage
| -rwxr-xr-x | client/partials/image/edit.html | 3 | ||||
| -rwxr-xr-x | server/core/Image.php | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/client/partials/image/edit.html b/client/partials/image/edit.html index 8c1575c..0a59c6f 100755 --- a/client/partials/image/edit.html +++ b/client/partials/image/edit.html @@ -38,9 +38,8 @@ <input type="hidden" name="task" value="image" /> <input type="hidden" name="token" value="{{ getToken()}}" /> <input type="hidden" name="action" value="uploadImage" /> - <input type="hidden" name="id" value="{{ image.id}}" /> - <input type="hidden" name="file_name" value="cirros-0.3.4-x86_64-disk.img" /> + <fieldset class="form-group"> <label class="control-label col-sm-2">Upload</label> <input name="file" type="file"/> diff --git a/server/core/Image.php b/server/core/Image.php index ac967d5..f8cac04 100755 --- a/server/core/Image.php +++ b/server/core/Image.php @@ -388,7 +388,6 @@ class image implements Core{ */ private function uploadImage(){ $id = $this->app->getPostParam("id"); - $file = $this->app->getPostParam("file"); $file_name = $_FILES['file']['name']; $file_error = $_FILES['file']['error']; $file_tmp = $_FILES['file']['tmp_name']; @@ -406,10 +405,10 @@ class image implements Core{ return; } if( !is_uploaded_file($file_tmp) ) - { - $this->app->setOutput("Error", "File Upload Error"); + { + $this->app->setOutput("Error", "File Upload Error"); return; - } + } if(!isset($id)){ $this->app->setOutput("Error", "Incorrect id parameter"); |
