Laravel uploading file Unable to write in directory
chmod 755 /var/www/html/public/system
and chown www-data:www-data /var/www/html/public/system
as stated by @JLPuro works perfectly. Thanks a lot guys.
permission for folder sudo chmod 777./(folder name)
for file sudo chmod 777 -R ./(file name)
Whenever you have to create a directory use this:
use File;use Illuminate\Foundation\Bus\DispatchesJobs;
use this in controller
if (!file_exists(public_path().'system')) { if(File::makeDirectory(public_path().'system',0777,true)){ } }
use this in your function