Welcome Guest, Not a member yet? Register   Sign In
deleting files with delete_files() in helper
#6

Turned out that I didn't know how to use delete_files. It deletes all the files of a directory, when I just wanted to delete a specific file.

Here is the solution that worked.
$cmd = "rm ". '/app/assets/uploads/files/'. $user->file_url;
$result = shell_exec($cmd);

//delete thumbnail
$cmd = "rm ". '/app/'. $user->thumbnail_url;
shell_exec($cmd);
proof that an old dog can learn new tricks
Reply


Messages In This Thread
RE: deleting files with delete_files() in helper - by richb201 - 09-10-2020, 05:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB