jQuery, Add / Delete elements without page refresh |
[eluser]Natebot[/eluser]
Jeff, Codeigniter has got your back (as usual). Listing the files located in a directory is a snap. Consult the user guide's section on the file helper http://ellislab.com/codeigniter/user-gui...elper.html Code: get_filenames('path/to/directory/') returns an array of file names. Just use a foreach loop to step through the array to create your list of links. Deleting them can be done like you did above with an ajax call to another controller method and pass the file's name. Just make sure you control where the script is unlinking files - you don't want the user deleting files elsewhere on your server! |
Welcome Guest, Not a member yet? Register Sign In |