Bravo List
Register
Go Back   > Bravo List > Source Code > Active Trackers > UNIT3D
Reply
  #1  
Old 1st July 2019, 14:37
marc234's Avatar
marc234 marc234 is offline
Senior Member
 
Join Date: Apr 2008
France
Posts: 32
Default 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
Reply With Quote
  #2  
Old 1st July 2019, 16:38
Stortebeker's Avatar
Stortebeker Stortebeker is offline
Member
 
Join Date: May 2019
Posts: 8
Default
Verify if you have the folder /var/www/html/public/files/img/ , and make sure you have write permission 755.
Reply With Quote
  #3  
Old 1st July 2019, 18:39
marc234's Avatar
marc234 marc234 is offline
Senior Member
 
Join Date: Apr 2008
France
Posts: 32
Default
not work just try!
Reply With Quote
  #4  
Old 1st July 2019, 19:53
Napon's Avatar
Napon Napon is offline
Senior Member
 
Join Date: Feb 2016
P2P
Posts: 417
Default
this should work write permission 0777 as 0755 not work
__________________
https://uploadfiles.io/lgekz
Reply With Quote
  #5  
Old 1st July 2019, 19:55
Stortebeker's Avatar
Stortebeker Stortebeker is offline
Member
 
Join Date: May 2019
Posts: 8
Default
/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']); }
Reply With Quote
  #6  
Old 1st July 2019, 20:09
marc234's Avatar
marc234 marc234 is offline
Senior Member
 
Join Date: Apr 2008
France
Posts: 32
Default
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))
Reply With Quote
  #7  
Old 1st July 2019, 20:50
Napon's Avatar
Napon Napon is offline
Senior Member
 
Join Date: Feb 2016
P2P
Posts: 417
Default
i would look for something else as this not good for u.. the host not good
__________________
https://uploadfiles.io/lgekz
Reply With Quote
  #8  
Old 1st July 2019, 21:13
Stortebeker's Avatar
Stortebeker Stortebeker is offline
Member
 
Join Date: May 2019
Posts: 8
Default
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.
Reply With Quote
  #9  
Old 1st July 2019, 22:38
marc234's Avatar
marc234 marc234 is offline
Senior Member
 
Join Date: Apr 2008
France
Posts: 32
Default
just tryt dont work! i got same error!

Quote:
Originally Posted by Stortebeker View Post
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.
Reply With Quote
  #10  
Old 1st July 2019, 23:34
Stortebeker's Avatar
Stortebeker Stortebeker is offline
Member
 
Join Date: May 2019
Posts: 8
Default
Quote:
Originally Posted by marc234 View Post
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)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 19:17. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2019, vBulletin Solutions Inc.