Test
This commit is contained in:
parent
237b627bf6
commit
a7bf9306d3
5 changed files with 22 additions and 17 deletions
|
@ -389,8 +389,9 @@ class image implements Core{
|
|||
private function uploadImage(){
|
||||
$id = $this->app->getPostParam("id");
|
||||
$file_name = $this->app->getPostParam("file_name");
|
||||
|
||||
|
||||
$file = $this->app->getPostParam("file");
|
||||
error_log(print_r($file, true), 0);
|
||||
|
||||
if(!isset($id)){
|
||||
$this->app->setOutput("Error", "Incorrect id parameter");
|
||||
}
|
||||
|
@ -405,7 +406,7 @@ class image implements Core{
|
|||
if($image == null){ // if the image don't exists -> error
|
||||
$this->app->setOutput("Error", "Image doesn't exist");
|
||||
}
|
||||
$stream = \GuzzleHttp\Psr7\stream_for(fopen($file_name, 'r'));
|
||||
$stream = \GuzzleHttp\Psr7\stream_for($file);
|
||||
$image->uploadData($stream);
|
||||
}catch(BadResponseError $e){
|
||||
$this->app->getErrorInstance()->BadResponseHandler($e);
|
||||
|
@ -684,4 +685,4 @@ class image implements Core{
|
|||
}
|
||||
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue