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

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -