Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   UNIT3D (http://www.bvlist.com/forumdisplay.php?f=129)
-   -   Can't write image data to path (http://www.bvlist.com/showthread.php?t=12124)

marc234 1st July 2019 14:37

Can't write image data to path
 
any ide haw to fix?

Code:

Can't write image data to path (/var/www/html/public/files/img/user.png) {"userId":3,"exception":"[object] (Intervention\\Image\\Exception\\NotWritableException(code: 0): Can't write image data to path (/var/www/html/public/files/img/user.png) at /var/www/html/vendor/intervention/image/src/Intervention/Image/Image.php:143)
thanks

Stortebeker 1st July 2019 16:38

Verify if you have the folder /var/www/html/public/files/img/ , and make sure you have write permission 755.

marc234 1st July 2019 18:39

not work just try!

Napon 1st July 2019 19:53

this should work write permission 0777 as 0755 not work

Stortebeker 1st July 2019 19:55

/var/www/html/vendor/intervention/image/src/Intervention/Image/Image.php

edit this file
change this :
if (is_null($path)) {
throw new Exception\NotWritableException(
"Can't write to undefined path."
);
}

$data = $this->encode(pathinfo($path, PATHINFO_EXTENSION), $quality);
$saved = @file_put_contents($path, $data);

if ($saved === false) {
throw new Exception\NotWritableException(
"Can't write image data to path ({$path})"
);
}

// set new file info
$this->setFileInfoFromPath($path);

return $this;
}`

to this :

$pathInfo = pathinfo($path); $data = $this->encode($pathInfo['extension'], $quality);
if(!\File::exists($pathInfo['dirname'])){ \File::makeDirectory($pathInfo['dirname']); }

marc234 1st July 2019 20:09

not work 777 and 755 !

laraval logo:

Code:

[stacktrace]
#0 /var/www/html/app/Http/Controllers/UserController.php(221): Intervention\\Image\\Image->save('/var/www/html/p...')
#1 [internal function]: App\\Http\\Controllers\\UserController->editProfile(Object(Illuminate\\Http\\Request), 'user', '3')
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('editProfile', Array)
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\UserController), 'editProfile')
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\\Routing\\Route->runController()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(680): Illuminate\\Routing\\Route->run()
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#8 /var/www/html/app/Http/Middleware/CheckIfBanned.php(43): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): App\\Http\\Middleware\\CheckIfBanned->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#11 /var/www/html/app/Http/Middleware/TwoStepAuth.php(33): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): App\\Http\\Middleware\\TwoStepAuth->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(43): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\Auth\\Middleware\\Authenticate->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#17 /var/www/html/app/Http/Middleware/SetLanguage.php(100): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))


Napon 1st July 2019 20:50

i would look for something else as this not good for u.. the host not good

Stortebeker 1st July 2019 21:13

not work 777 and 755 !

laraval logo:

The error is not from laravel script itself,it is from a third party module in this case 'Intervention/image' edit the code in the image.php.

marc234 1st July 2019 22:38

just tryt dont work! i got same error!

Quote:

Originally Posted by Stortebeker (Post 53868)
not work 777 and 755 !

laraval logo:

The error is not from laravel script itself,it is from a third party module in this case 'Intervention/image' edit the code in the image.php.


Stortebeker 1st July 2019 23:34

Quote:

Originally Posted by marc234 (Post 53869)
just tryt dont work! i got same error!

change this:
public function save($path = null, $quality = null, $format = null)
to:
public function save($path = null, $quality = null)


All times are GMT +2. The time now is 11:12.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2020, vBulletin Solutions Inc.