Welcome Guest, Not a member yet? Register   Sign In
How to delete the file
#3

(This post was last modified: 01-22-2016, 08:14 AM by meow.)

(11-24-2015, 03:20 AM)Diederik Wrote: File deletion is not part of a framework but a native php function. You are looking for the function unlink() (http://php.net/manual/en/function.unlink.php)

A small note, you cant delete a file based on the URL, the example you provide refers to a url (http://somedomain.com/uploads/images/somefile.jpg), you need to provide the (filebased) path to the file, for example:

PHP Code:
unlink(APPPATH '/uploads/images/somefile.jpg'); 

Thanks! Here are some more paths listed under CONSTANTS:
http://www.codeigniter.com/user_guide/ge...ht=apppath
Reply


Messages In This Thread
How to delete the file - by jdk - 11-23-2015, 11:33 PM
RE: How to delete the file - by Diederik - 11-24-2015, 03:20 AM
RE: How to delete the file - by meow - 01-22-2016, 08:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB