Removing files from the list if they no longer exist in the filesystem

Phoca Download - download manager
MarisaG
Phoca Member
Phoca Member
Posts: 12
Joined: 03 May 2026, 04:28

Removing files from the list if they no longer exist in the filesystem

Post by MarisaG »

I renamed and moved a bunch of files to new locations and deleted some and when I rescan it finds the new files/locations but leaves the old entries in the system even though they are no longer there. Is there a way to purge out files that don't exist anymore?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49405
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Removing files from the list if they no longer exist in the filesystem

Post by Jan »

Hi, if the file was added properly to Phoca Download system, it can be removed when option: "Delete existing files" is enabled.

Image

But there is no purge function as Phoca Download as independent database and filesystem layer, so a file on server can be e.g. used for other parts of the system.

Jan
If you find Phoca extensions useful, please support the project
MarisaG
Phoca Member
Phoca Member
Posts: 12
Joined: 03 May 2026, 04:28

Re: Removing files from the list if they no longer exist in the filesystem

Post by MarisaG »

I think that is in the reverse direction. I dont want it to remove files on the filesystem when i delete them in the backend, rather the files are deleted or moved from the shell and I want phocadownload to remove them from the database.
Do I need to create a script to check if each file still exists and remove it from the database if not?
MarisaG
Phoca Member
Phoca Member
Posts: 12
Joined: 03 May 2026, 04:28

Re: Removing files from the list if they no longer exist in the filesystem

Post by MarisaG »

What I did was just use the manager to delete all the entries and then rescan the filesystem again to add the existing ones back. From now on I'll do all the management inside the component and not the filesystem.
Post Reply