Posted By

assbach on 01/07/07


Tagged

delete files unlink


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

vali29
skywalker
jackkeller
silentbob84


Delete File from Server if exists


 / Published in: PHP
 

  1. #complete serverpath must be given like
  2. #example "/apache/htdocs/myfile.pdf" ( not "http:xyz.com/myfile.pdf" )
  3. $DelFilePath = $setup["serverWebrootPath"] . $fileName;
  4.  
  5. # delete file if exists
  6. if (file_exists($DelFilePath)) { unlink ($DelFilePath); }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Muhammad on February 7, 2011

hi, thanks a lot for your help. It works for me. Any one need more help please visit Web Knowledge

You need to login to post a comment.