php - Laravel's Storage::makeDirectory returns mkdir: invalid argument -
so i'm trying create new directory in c:/..../public/videos
folder when uploads video, using following code:
if ($request->hasfile('video')) { $newdir = public_path('videos\\' . $story->story_id); storage::makedirectory( $newdir, 0755, true); $request->file('video')->move($newdir); }
but error:
errorexception in local.php line 350: mkdir(): invalid argument in local.php line 350 @ handleexceptions->handleerror('2', 'mkdir(): invalid argument', 'c:\xampp\htdocs\qanda2\vendor\league\flysystem\src\adapter\local.php', '350', array('dirname' => 'c:\xampp\htdocs\qanda2\public\videos\31', 'config' => object(config), 'location' => 'c:\xampp\htdocs\qanda2\storage\app\c:\xampp\htdocs\qanda2\public\videos\31', 'umask' => '0', 'visibility' => 'public')) @ mkdir('c:\xampp\htdocs\qanda2\storage\app\c:\xampp\htdocs\qanda2\public\videos\31', '493', true) in local.php line 350 @ local->createdir('c:\xampp\htdocs\qanda2\public\videos\31', object(config)) in filesystem.php line 259 @ filesystem->createdir('c:\xampp\htdocs\qanda2\public\videos\31') in filesystemadapter.php line 276
it seems makedirectory automatically adds c:\xampp\htdocs\qanda2\storage\app\
in front of path.
is there workaround this? i've been struggling while , can't find issue.
to create directory, should use file
, this:
if ($request->hasfile('video')) { $newdir = public_path('videos\\' . $story->story_id); file::makedirectory( $newdir, 0755, true); $request->file('video')->move($newdir); }
Comments
Post a Comment