This commit is contained in:
Loic GUEGAN 2016-05-09 12:30:27 +02:00
commit a7d79d60ab
2 changed files with 4 additions and 4 deletions

View file

@ -41,6 +41,7 @@
<input type="hidden" name="id" value="{{ data.id}}" /> <input type="hidden" name="id" value="{{ data.id}}" />
<input type="hidden" name="file_name" value="cirros-0.3.4-x86_64-disk.img" /> <input type="hidden" name="file_name" value="cirros-0.3.4-x86_64-disk.img" />
<fieldset class="form-group"> <fieldset class="form-group">
<label class="control-label col-sm-2">Upload</label> <label class="control-label col-sm-2">Upload</label>
<input name="file" type="file"/> <input name="file" type="file"/>

View file

@ -388,7 +388,6 @@ class image implements Core{
*/ */
private function uploadImage(){ private function uploadImage(){
$id = $this->app->getPostParam("id"); $id = $this->app->getPostParam("id");
$file = $this->app->getPostParam("file");
$file_name = $_FILES['file']['name']; $file_name = $_FILES['file']['name'];
$file_error = $_FILES['file']['error']; $file_error = $_FILES['file']['error'];
$file_tmp = $_FILES['file']['tmp_name']; $file_tmp = $_FILES['file']['tmp_name'];
@ -406,10 +405,10 @@ class image implements Core{
return; return;
} }
if( !is_uploaded_file($file_tmp) ) if( !is_uploaded_file($file_tmp) )
{ {
$this->app->setOutput("Error", "File Upload Error"); $this->app->setOutput("Error", "File Upload Error");
return; return;
} }
if(!isset($id)){ if(!isset($id)){
$this->app->setOutput("Error", "Incorrect id parameter"); $this->app->setOutput("Error", "Incorrect id parameter");