php - unlink($filename) : Permission denied Warning -
i getting permission denied waring when try use unlink().
i have created function delete image content directory :
function del($fnam){ chmod('content/'.$fnam, 0777); chown('content/'.$fnam,465); unlink('content/'.$fnam); }
i have used chmod() , chown() after reading forums , still getting warning , image not getting deleted.
how ever runs charm when call different location.
if($temp2==1){ //for delete $sql="delete blog b_id=$temp1"; $im=fetch('blog','b_img','b_id='.$temp1); //deleting image del($im); }
code above not in function (running procedural fashion), , giving me positive response. how fix that?
try changing permissions content directory
function del($fnam){ chmod('content/, 0777); unlink('content/'.$fnam); }
Comments
Post a Comment