javascript - How to delete file in a dir using php script -


i want delete image inside profile_images folder. tried

unlink(base_url() . "_profile_images/912aea1dd8144e07894f788978b917d3.jpg"); 

and error occured

a php error encountered

severity: warning

message: unlink() [function.unlink]: http not allow unlinking  filename: controllers/controller.php  line number: 100 

i used codeigniter implement action. there way delete file?

you attempting delete url string, should php full path , filename file able unlink it.

not sure path is, php has several functions should full directory path file.

$_server['document_root']; // php's document root, it's start. 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -