John Holland website — johnholland.com.au
The client deleted files from Strapi's Media Library believing they were removed. They are not — 34 PDFs and 303 images remain publicly accessible via direct URL, including sensitive community agreements and environmental monitoring reports.
The client deletes a file from Strapi's Media Library. The file disappears from the Media Library interface — so it looks like it's gone. But if someone knows the direct URL, they can still open the file in their browser as if nothing happened.
Of those 337 orphaned files, 34 are PDFs — many of which are sensitive documents (community agreements, environmental licences, monitoring reports).
The site was originally built using AWS S3 as the file storage provider. At some point, it was migrated to local disk storage on the server. The files were physically moved to the server — but the database was never updated to reflect the change.
| Provider recorded in DB | Number of files | Status |
|---|---|---|
aws-s3 |
1,008 files | Old provider Mismatch |
strapi-provider-upload-aws-s3-custom |
522 files | Old provider Mismatch |
local |
39 files | Current provider ✓ |
The actual server config uses provider: 'local' — but 1,530 files in the DB still say they belong to S3.
This mismatch is the root cause. Here is exactly what happens step by step when the client deletes a file:
provider: aws-s3.
/opt/johnholland/uploads/ is untouched. Anyone who knows the URL can still access it.
Strapi is looking in the wrong place when it tries to delete a file. It goes to S3 (the old storage), not the local disk (the current storage). So the Media Library shows the file as deleted, but it's still sitting on the server — publicly accessible.
These 34 PDFs are confirmed orphaned — not in Strapi, but still downloadable via direct URL:
There are three steps to fully resolve this — an immediate action, a database correction, and a process improvement.
We already know exactly which 34 PDF files are orphaned. We can delete them directly from the server with a single script. This stops any further access to sensitive documents right away.
The other orphaned files (mostly images) should also be cleaned up. These were deleted from the Media Library by the client but never removed from disk. We can run the same cleanup script for all 337 orphaned files at once.
Update all file records in the DB from aws-s3 / strapi-provider-upload-aws-s3-custom to local. This fixes the root cause — future deletes from the Media Library will now correctly remove the physical file from disk.
| Question | Answer |
|---|---|
| Why can people still access deleted files? | The database told Strapi to delete from S3. Strapi never deleted the file from the server's disk. |
| Is this a Strapi bug? | Partially — Strapi should surface a failure when the provider mismatch occurs. But the primary cause is the incomplete S3 → local migration. |
| How many files are affected? | 337 files total — 34 PDFs, 303 images/SVGs. |
| Can we fix it without downtime? | Yes — deleting files and updating the DB does not require any service restart. |
| Will this happen again after the fix? | No — once the provider field is corrected (Step 3), future Media Library deletes will work correctly. |