diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-04-03 11:15:52 +0200 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-04-03 11:15:52 +0200 |
| commit | a7bf9306d3844acd160034bb5c64e1ca7ef77ddc (patch) | |
| tree | 2862ebc4c319b0d48f73173e8f2da58f61e1a319 /server/core/Image.php | |
| parent | 237b627bf6cdf31e8923fc67653a73b6b9978540 (diff) | |
Test
Diffstat (limited to 'server/core/Image.php')
| -rwxr-xr-x | server/core/Image.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/core/Image.php b/server/core/Image.php index c595135..59f7aed 100755 --- a/server/core/Image.php +++ b/server/core/Image.php @@ -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{ } } -?>
\ No newline at end of file +?> |
