laravel 4 - Unable to create the "app/uploads/nameof the folder/1578/3" directory Lravel4 on Digital Ocean server -
i code throwing error
unable create "app/uploads/rescom summit bangalore 2016/1578/3" directory
if (input::file($key)->isvalid()) { $destinationpath = 'app/uploads/'.$event.'/'.$userid.'/3'; // upload path $extension = input::file($key)->getclientoriginalextension(); // getting image extension $name = input::file($key)->getclientoriginalname(); $curfilesize = input::file($key)->getclientsize(); $mime =input::file($key)->getmimetype(); // dd($mime); //$filename = $name; // renameing image //$exstfilesize = input::file($destinationpath, $filename); if (!file::exists($destinationpath."/boq-".$name)){ //creating details saving inthe file_handler table $filetblobj->user_id = $userid; $filetblobj->eventname = $event ; $filetblobj->filename = "boq-".$name; $filetblobj->formpage =3 ; $filetblobj->filepath = $destinationpath."/"; $filetblobj->mime= $mime; $ans->answer_text = 'yes'; input::file($key)->move($destinationpath, "boq-".$name); // uploading file given path //input::file($key)->move($boqpath, $boqname); // uploading file given path //save filedetails $filetblobj->save(); $ans->save(); session::flash('success', 'upload successfully'); }else if(file::size($destinationpath."/".$name) != $curfilesize){ $filedtls = $filetblobj->where('uid',$userid)->where('filename',$name)->where('formpage',3)->first(); input::file($key)->move($destinationpath, $name); $ans->answer_text = 'yes'; $ans->save(); $filetblobj->where('id',$filedtls->id)->update(array('updated_at'=>date("y-m-d h:m:s",time()))); } //return redirect::to('upload'); }
also in browser getting
protected function gettargetfile($directory, $name = null) { if (!is_dir($directory)) { if (false === @mkdir($directory, 0777, true)) { throw new fileexception(sprintf('unable create "%s" directory', $directory)); } } elseif (!is_writable($directory)) {
this works fine on local system
i have changed permission
chmod -r 777 /var/www/laravel/app
can me out this
thanks
Comments
Post a Comment