Reputation: 5
This is the error i m receiving when i m trying to delete an user post from the admin section of my web app which was designed by a third part in laravel. I seem to not find any clue why i am receiving this. Any help would be great and i am a newbie here and i appreciate all of your time and effort!
Error: exception 'ErrorException' with message 'unlink(./uploads/images/) [function.unlink]: Is a directory' in /home/studifzr/public_html/wizflip.com/app/controllers/MediaController.php:400
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleError(2, 'unlink(./upload...', '/home/studifzr/...', 400, Array)
#1 /home/studifzr/public_html/wizflip.com/app/controllers/MediaController.php(400): unlink('./uploads/image...')
#2 [internal function]: MediaController->delete('235')
#3 /home/studifzr/public_html/wizflip.com/vendor/laravel/framework/src/Illuminate/Routing/Controllers/Controller.php(138): call_user_func_array(Array, Array)
#4 /home/studifzr/public_html/wizflip.com/vendor/laravel/framework/src/Illuminate/Routing/Controllers/Controller.php(115): Illuminate\Routing\Controllers\Controller->callMethod('delete', Array)
#5 /home/studifzr/public_html/wizflip.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(985): Illuminate\Routing\Controllers\Controller->callAction(Object( Illuminate\Foundation\Application), Object(Illuminate\Routing\Router), 'delete', Array)
#6 [internal function]: Illuminate\Routing\{closure}('235')
#7 /home/studifzr/public_html/wizflip.com/vendor/laravel/fr amework/src/Illuminate/Routing/Route.php(80): call_user_func_array(Object(Closure), Array)
#8 /home/studifzr/public_html/wizflip.com/vendor/laravel/fr amework/src/Illuminate/Routing/Route.php(47): Illuminate\Routing\Route->callCallable()
#9 /home/studifzr/public_html/wizflip.com/vendor/laravel/fr amework/src/Illuminate/Routing/Router.php(1016): Illuminate\Routing\Route->run(Object( Illuminate\Http\Request ))
#10 /home/studifzr/public_html/wizflip.com/vendor/laravel/f ramework/src/Illuminate/Foundation/Application.php(576): Illuminate\Routing\Router->di spatch(Object(Illuminat e\Http\Request))
#11 /home/studifzr/public_html/wizflip.com/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(552): Illuminate\Foundation\Application->dispatch(Object(I lluminate\Http\Request))
#12 /home/studifzr/public_html/wizflip.com/public/index.php(49): Illuminate\Foundation\Application->run()
#13 {main}
Thank you so much from the bottom of my heart
Upvotes: 0
Views: 306
Reputation: 146269
Error: exception 'ErrorException' with message 'unlink(./uploads/images/) [function.unlink]: Is a directory' in /home/studifzr/public_html/wizflip.com/app/controllers/MediaController.php:400
It's saying that, when you delete a user, from MediaController->delete()
method it also triggers a file delete from the server's file system on line 400
but the given path to delete the file is not a valid file instead it's public/uploads/images
, which is a directory.
Check in the MediaController->delete()
method and provide the file name to delete, you gave only the folder (public/uploads/images
) as the location of file but missed the file name, so give the file name after the path, i.e. public/uploads/images/somefilename.png
.
Upvotes: 1