Advanced Filesystem
Take control of where your files live on disk, find the orphans, sanitize filenames, strip metadata, enforce upload quotas, extract rich EXIF/IPTC/XMP metadata, automate file lifecycle policies, generate AI-powered alt text, transform images on demand, compress uploads automatically, generate signed access-controlled download URLs, and rewrite all public file URLs to your CDN — all from Drupal's admin UI.
Overview
Advanced File System turns Drupal's file storage into a manageable, observable and maintainable subsystem. It ships a pluggable path strategy API (13 built-in strategies) to control where uploaded files land on disk, a batch migration tool with dry-run preview and confirmation step, a unified dashboard, a detailed file report with filters and CSV / JSON export, upload-time processing hooks (filename sanitization, duplicate resolver, EXIF stripping), and a suite of background services that monitor orphans, record storage growth, run retention rules, deduplicate content and rewrite hardcoded URLs after a migration.
The module ships a lean core plus sixteen sub-modules, four of which are automatically enabled on install and can be disabled independently. The remaining sub-modules are installed on demand:
- advanced_filesystem_dedup — hash-based deduplication, visual similarity (pHash), duplicate email alerts
- advanced_filesystem_cleanup — orphan management, dead image styles, bulk deletion, ghost file scanner, filename sanitizer, file tools
- advanced_filesystem_reports — storage growth, folder sizes, file dependency graph, private file access
- advanced_filesystem_quota — per-user and per-role upload quota enforcement with dashboard and per-user file listing
- advanced_filesystem_backup — scheduled/manual/queue-triggered file backups to Local, FTP, S3, Cloudflare R2, or Google Cloud Storage; ZIP or file-by-file mode; restore & download
- advanced_filesystem_remote_sync — pull all files from another Drupal server over HTTP Basic Auth; useful after importing a database dump to a new server
- advanced_filesystem_upload_directory — automatically routes file/image field uploads to a configured directory at entity save time; per-field rules, global fallback, stream-wrapper selector, token support in paths, automatic directory creation, and a built-in file browser
- advanced_filesystem_lifecycle_manager — config-entity lifecycle policies with conditions, time-based thresholds, archive/delete/notify/webhook actions, audit log, legal hold, restore, conflict detector, and per-field/per-bundle scoping
- advanced_filesystem_metadata — extracts EXIF, IPTC, XMP, PDF, audio, and video metadata into typed fields on the file entity; group-based enablement; retry-guard prevents corrupted files from looping the queue indefinitely
- advanced_filesystem_ai_transcription — pluggable semantic extraction pipeline: audio/video transcription, image captioning, PDF OCR, text enrichment, AI taxonomy tagging, vector embeddings, image analysis (objects / category / colors as hex strings / brands / bounding boxes / confidence scores), safety scoring, and face/emotion detection; powered by
drupal/aiprovider abstraction - advanced_filesystem_ai_alt_text — automatic alt text generation for image fields using AI vision; inline widget button, batch UI, and Drush command
- advanced_filesystem_ai_smart_image — AI-powered filename suggestions for image files using a vision provider; per-file AJAX form, batch processing UI, conflict detection, auto-apply on upload, and apply-mode selector (display name or full rename)
- advanced_filesystem_smart_image — on-demand adaptive image derivative endpoint (
/adfs/image?src=…&w=…&fmt=…); resize, crop, filters, watermark, format negotiation, HMAC signing, transform plugin API,|adfs_srcsetTwig filter, and cache warm-up batch - advanced_filesystem_image_optimizer — automatic GD-based image compression, dimension capping, and optional WebP conversion on every file save; configurable JPEG quality, PNG compression, MIME type filter, and savings statistics dashboard
- advanced_filesystem_access — HMAC-SHA256 signed download URLs with configurable TTL; per-file download limits, IP allowlists/blocklists (CIDR-aware), global IP blocklist, full download access log with pruning, and
|adfs_signed_urlTwig filter - advanced_filesystem_cdn — transparent CDN URL rewriting via
hook_file_url_alter(); cache-busting (timestamp or SHA-256 hash); MIME type filter; exclusion patterns;|adfs_cdn_urlTwig filter; multi-provider cache purge (Cloudflare, BunnyCDN, Fastly, AWS CloudFront with native Sig v4, Generic/Varnish); auto-purge on file update/delete; manual purge form - advanced_filesystem_antivirus — ClamAV malware scanning on upload (TCP daemon, Unix socket, or CLI); configurable on-infection action (block / warn / log); bulk re-scan batch UI; signature database status on the dashboard; per-file detection log
- advanced_filesystem_lgpd_gdpr — personal-data scanner for CPF, CNPJ, e-mail, phone, credit card numbers, and custom regex patterns; Batch API and cron-queue modes; filterable findings table; scan-tracking table (clean / flagged per file)
- advanced_filesystem_webhooks — HTTP webhook dispatch on file events (upload, delete, antivirus detection, quota breach, LGPD finding); HMAC-SHA256 signed payloads; async queue delivery with configurable retries; per-endpoint event subscriptions; delivery log; compatible with Slack, Teams, n8n, Zapier, Make, and any HTTP endpoint
- advanced_filesystem_ai_embeddings — 127-dimension self-contained visual embeddings (colour + structure + texture, no external API required); cosine-similarity search; k-means++ clustering with gallery UI; hybrid visual+semantic search with configurable α blending; REST/JSON API (stats, item, similar, clusters); pHash + dHash + quality metrics stored per image
- advanced_filesystem_pdf_processor — enterprise PDF manipulation (Ghostscript + Poppler): 16 operation tabs (page range cut, keep/remove pages, password protect, thumbnails, split, OCR, compress, watermark, remove password, resize, rotate, extract images, PDF/A conversion, merge with AJAX preview); derivatives history with color-coded badge, file size, delete and export; per-file export creates a Drupal-managed File entity; dashboard with disk usage, clean old, and reprocess failed; Drupal Media Source Plugin + Views integration
- advanced_filesystem_video_processor — frame-accurate video manipulation (FFmpeg): 13 operation tabs (thumbnail, trim, resize, crop, extract audio, convert format H.264/HEVC/VP9/AV1, speed, GIF, normalize audio, contact sheet, watermark, subtitles, HLS adaptive streaming); side-by-side VideoCompareController; derivatives history with badge/size/delete/export; dashboard; Drupal Media Source Plugin + Views integration
- advanced_filesystem_document_processor — document conversion and manipulation (LibreOffice): 15 operation tabs (convert to PDF/DOCX/ODT, extract text, compress, password protect, add page numbers, remove tracked changes, mail merge, extract metadata, remove metadata, redact text, watermark, digital signature, merge); DocumentDiffForm (word-level LCS diff); derivatives history with badge/size/delete/export; dashboard; Drupal Media Source Plugin + Views integration
- advanced_filesystem_presentation_processor — presentation processing (LibreOffice + Ghostscript): PPTX/ODP to PDF export, per-slide PNG thumbnails, text + speaker-notes extraction, embedded metadata extraction; Drupal Media Source Plugin + Views integration
Built around standard Drupal patterns: Plugin API, Batch API, Queue API, Cron, Mail, State and the Symfony EventDispatcher.
The module ships a lean core plus twenty-four sub-modules. Four are automatically enabled on install; the remaining twenty are installed on demand. The unified dashboard at /admin/reports/advanced_filesystem aggregates live metrics from every enabled sub-module automatically — no configuration required.
Highlights
Path organization
- 13 built-in path strategies — from simple (flat, year) to advanced (CDN hash, date+hash, MIME type, content type, field name, user role, locale-aware).
- Strategy presets — one-click configuration combos for the most common layouts.
- Strategy simulator — enter a fictional file and instantly see the URI every installed strategy would produce, in dry-run mode with no disk writes.
- Cron-based automatic migration — schedule file migration to run automatically on cron with configurable interval and per-run cap.
Visibility & reporting
- Dashboard — single page with cards for stream wrappers, orphan counts, retention queue, migration stats, last rollback / rewrite, lifetime totals and audit-log entries. Cards for sub-modules appear automatically when enabled.
- File report — filters (path, MIME, status, size range, field, used / unused), pagination, CSV / JSON export.
- Folder report — recursive size and extension breakdown of any stream wrapper, with top-N largest files.
- Storage growth report — historical snapshots of total storage and file count recorded on every cron run, with delta and percentage-change columns. Up to 90 snapshots retained.
- File dependency graph — find which entities reference a file; detect dead
file_usagerows.
Upload-time processing
- Filename sanitizer — on
hook_file_presave(): transliterate, lowercase, replace whitespace with a configurable separator, strip special characters, enforce max length. - Duplicate filename resolver — detects URI collisions in
file_managedand auto-appends a numeric suffix (photo-2.jpg, photo-3.jpg…) instead of overwriting. - Media metadata stripper — re-encodes JPEG / PNG / WebP via PHP GD to strip EXIF / IPTC metadata (GPS coordinates, camera model, author name…).
- File Quota Manager — enforces per-user and per-role upload quotas via
hook_file_validate(). Most restrictive rule wins. Multi-user rule targeting supported.
Cleanup & maintenance
- Orphan files monitor — read-only cron email alert when unreferenced file count crosses a configurable threshold.
- Bulk delete orphans — one-click batch deletion of all currently detected orphan files, with two-step confirmation.
- Retention rules — multi-rule cron actor: delete or quarantine unreferenced files older than N days, per-directory rule patterns, capped per run, optional dry-run and email report.
- Dead image styles — detect image styles no longer referenced anywhere; flush derivatives or delete the style entirely.
- Deduplication — SHA-256 hash detection, repoints file_usage and entity references to the canonical fid.
- Visual similarity deduplication — 64-bit perceptual hash (dHash) groups near-duplicate images in a 4-column gallery UI; configurable Hamming distance threshold.
- Duplicate file alerts — separate cron-based email notification when duplicate groups exceed a configurable threshold.
- Ghost files scanner — batch scan that diffs
file_managedagainst the real filesystem. Detects missing files (in DB, not on disk) and orphan files (on disk, not in DB). Configurable exclusions for auto-generated directories. Results page with paginated table, filter tabs, reclaimable disk-space totals, CSV export, and two-step irreversible deletion.
Lifecycle Manager (new)
- Config-entity lifecycle policies — machine name, label, description, priority, enabled toggle. Evaluated on every cron run or on demand.
- Flexible conditions — entity type, bundle, MIME type (wildcards), file size range, lifecycle status, EXIF metadata presence, minimum age (minutes / hours / days), and referencing entity context (entity type + bundle + field).
- Per-field / per-bundle scoping — restrict a policy to files referenced from a specific content type or field. The lookup uses a single direct DB query on
file_usage(no N+1 entity loading unless bundle/field filtering is needed). - Time-unit aware thresholds — archive-after, delete-after, and min-age all accept minutes, hours, or days. Legacy
_daysvalues are migrated transparently. - Actions: archive to configurable stream wrapper / subdirectory (directory auto-created at form save), soft delete, hard delete, strip EXIF metadata, email notifications with custom templates, and webhook (HTTP POST JSON payload).
- Cron schedule per policy — day-of-week and hour-of-day restrictions.
- Queue deduplication — in-memory set prevents the same file+policy pair from being enqueued twice per request.
- Audit log — every action recorded in
lifecycle_audit_logwith a filterable admin view. - Legal hold — per-file flag via CSRF-protected endpoints; files on hold are never processed.
- Restore action — moves archived files back to their original URI, resets lifecycle status to active.
- Batch preview & batch run — Preview button shows up to 20 matching files without queuing; Batch run shows a Batch API progress bar.
- Policy conflict detector — warns when two enabled policies have overlapping scopes and thresholds.
AI Transcription / Semantic Extraction (new)
- Image analysis extractors — three new vision AI extractors for images:
- ImageAnalysisExtractor — detects objects, classifies category, identifies dominant colors and brand logos; all stored as taxonomy terms. Supports both
chat_with_image_vision(all 4 dimensions) and the nativeobject_detectionAPI (objects only, with bounding boxes and confidence scores). - ImageSafetyExtractor — rates nudity, violence, drugs and weapons; result stored as JSON (
adfs_ai_safety_score). - ImageFaceEmotionExtractor — counts adults, children, and dominant emotions; results stored as JSON (
adfs_ai_faces_json,adfs_ai_emotions_json).
- ImageAnalysisExtractor — detects objects, classifies category, identifies dominant colors and brand logos; all stored as taxonomy terms. Supports both
- 7 new image analysis fields on the file entity:
adfs_ai_objects,adfs_ai_category,adfs_ai_colors,adfs_ai_brands(all taxonomy term references),adfs_ai_safety_score,adfs_ai_faces_json,adfs_ai_emotions_json(JSON strings). - Auto-created vocabularies — enabling taxonomy for any image dimension creates the vocabulary automatically.
Image Optimizer (new)
- Automatic compression on upload — processes every image on
hook_file_presave()via PHP GD. Static recursion guard prevents double-processing. - Dimension cap — optionally resize images to a configurable maximum width and/or height while preserving aspect ratio.
- Per-format quality control — JPEG quality 1–100 (default 85); PNG compression level 0–9 (always lossless).
- WebP conversion — writes an additional
.webpcopy alongside the original after optimization. - EXIF stripping — re-encoding via GD removes all EXIF/IPTC metadata (GPS, camera model, author, copyright, etc.).
- MIME type filter — configure exactly which image types to process.
- Savings statistics — lifetime bytes saved and file count tracked in Drupal State; visible in the settings form with a one-click reset button.
Access Control (new)
- HMAC-SHA256 signed URLs — generate time-limited, tamper-proof download URLs for any file entity. Token encodes
fid+expires; validated withhash_equals(). - Secure download endpoint —
/adfs/download/{fid}/{token}?expires={ts}: validates token, checks IP, enforces per-file download limit, logs attempt, streams viaBinaryFileResponse. - Per-file access rules — download limit (0 = unlimited), IP allowlist, IP blocklist, expiry timestamp — all configurable per FID via the service API.
- CIDR-aware IP rules — both per-file and global rules accept exact IPs or CIDR ranges (e.g.
192.168.0.0/16,2001:db8::/32). - Global IP blocklist — site-wide blocklist applied to every download, regardless of per-file rules.
- Download access log — every request (allowed and blocked) recorded with FID, UID, IP, user-agent, method, and timestamp. Filterable admin view; configurable retention with one-click pruning.
|adfs_signed_urlTwig filter — generate signed URLs in templates. AcceptsFileInterface, integer FID, or field item list. TTL accepts seconds or shorthand strings:"30m","2h","7d","1w".hook_file_access()integration — blocks thedownloadoperation once the per-file limit is reached.
CDN Integration (new)
- Transparent URL rewriting — rewrites all public file URLs to a CDN base URL via
hook_file_url_alter(). Zero template changes required. - CDN path prefix & path stripping — configurable path prefix; optionally removes
sites/default/files/from CDN URLs. - Cache-busting — three modes: none, timestamp (file mtime), and hash (SHA-256 of file content). Appended as a configurable query parameter (default
v=). - MIME type filter — limit rewriting to specific MIME prefix groups (e.g. only
image/*andvideo/*). - Exclusion patterns — glob-style patterns (one per line) to skip specific paths from CDN rewriting.
- Live URL preview — the settings form shows a before/after URL preview with current settings applied.
|adfs_cdn_urlTwig filter — generate CDN URLs in templates from URI strings,FileInterfaceobjects, or field items. Falls back to the standard Drupal URL when CDN is disabled or excluded.- Multi-provider cache purge:
- Cloudflare — Bearer token + zone ID; per-URL and purge-all.
- BunnyCDN — account API key; per-URL and pull-zone purge-all.
- Fastly — API key + service ID; soft purge via HTTP PURGE method.
- AWS CloudFront — native AWS Signature Version 4 (no SDK required); distribution invalidation.
- Generic / Varnish — configurable HTTP method (PURGE / BAN / DELETE), custom headers as JSON, configurable purge-all URL.
- Auto-purge on file events — optional auto-purge on
hook_file_update()andhook_file_delete(). - Manual purge form — purge all, by absolute CDN URL, by Drupal URI (auto-converted), or by FID.
Smart Image (updated)
- Vision AI filename suggestions — sends an image to a
chat_with_image_visionprovider and receives a human-readable, SEO-friendly slug (e.g. golden-retriever-puppy-grass). - Per-file AJAX form — accessible at
/admin/content/files/{fid}/smart-filename; shows image preview, existing suggestion with status badge, an AJAX generate button, editable slug field, and conflict preview warning. - Conflict detection — checks
file_managed.filenamefor collisions and automatically appends a numeric suffix (-1, -2…) before applying. - Two apply modes — display name only (safe — updates the filename shown in admin without moving files on disk) and full rename (moves the file on disk and updates the URI).
- Batch processing — bulk suggestion and apply for any selection of image files, with MIME filter, status filter, chunk size, and Drupal Batch API progress bar.
- Auto-suggest and auto-apply on upload — optional
hook_file_inserttrigger; auto-apply can be configured independently of auto-suggest. - Suggestion tracking — custom DB table stores status (suggested / applied / skipped / failed), original filename, provider ID, and timestamps per file.
- 14 metadata groups — EXIF camera, image properties, exposure, lens, GPS, dates, copyright, IPTC, XMP, image info, PDF, audio, video. Enable only the groups you need.
- Retry-guard queue worker — tracks consecutive extraction failures per fid in State. After 3 failures the item is consumed (not re-queued) and the file is marked
adfs_metadata_extraction_status = failed. Prevents corrupted files from looping the queue indefinitely. - Extraction status field (
adfs_metadata_extraction_status) —pending | done | failed | skipped. Set on every queue worker outcome; queryable via Views or Entity Query. - Batch re-extraction — re-queue files for metadata extraction in bulk, with overwrite control.
Enterprise file processors (new)
- PDF Processor — 16 operation tabs powered by Ghostscript and Poppler: page range cut, keep/remove pages, password protect, thumbnail gallery (auto-generated on first load for done jobs), split into N parts, OCR (Tesseract), compress (prepress/printer/ebook/screen), watermark, remove password, resize, rotate, extract images as ZIP, PDF/A conversion, and merge with AJAX merge preview (real-time filename + page count + size for each selected PDF before merging).
- Video Processor — 13 operation tabs powered by FFmpeg: thumbnail extraction, trim, resize, crop, extract audio (MP3/AAC/WAV/FLAC), convert format (H.264/HEVC/VP9/AV1 with CRF), speed change with pitch correction, animated GIF with palette optimization, loudness normalization (EBU R128), contact sheet grid, image watermark, embed subtitles (SRT/VTT), and HLS adaptive streaming (.m3u8 + .ts). Includes a VideoCompareController for side-by-side derivative comparison.
- Document Processor — 15 operation tabs powered by LibreOffice: convert to PDF/DOCX/ODT, extract plain text, compress (ZIP), password protect, add page numbers, remove tracked changes, mail merge (CSV/JSON data source), extract metadata, remove metadata, redact text patterns, watermark, digital signature, and merge with configurable separator page. Includes a DocumentDiffForm with word-level LCS diff (additions in green, deletions in red).
- Presentation Processor — full-presentation PDF export, per-slide PNG thumbnails, speaker-notes extraction, and embedded metadata extraction (slide count, author, title, subject) for PPTX, ODP, and any LibreOffice-compatible format.
- Shared UX across all processors: color-coded derivatives history table (green=done, red=failed, orange=processing, blue=pending) with file size, per-derivative Delete (CSRF-validated) and Export as managed File (copies to
public://adfs_export_*and creates a DrupalFileentity) buttons; per-processor Dashboard with disk usage stats, "Clean old derivatives" button, and "Reprocess failed jobs" button.
Media entity integration (new)
- Each of the seven modules below ships a Drupal Media Source Plugin that exposes processor job data as named metadata attributes mappable to Media entity fields. No custom code required — create a Media type, select the plugin, map attributes to fields.
adfs_pdf_processor
advanced_filesystem_pdf_processor
page_count, word_count, is_scanned, is_pdfa, pii_found, status, thumbnail_uri, text_extracted
adfs_video_processor
advanced_filesystem_video_processor
duration, width, height, fps, video_codec, audio_codec, bitrate, status, thumbnail_uri, hls_uri
adfs_document_processor
advanced_filesystem_document_processor
page_count, word_count, char_count, author, title, subject, pii_found, status
adfs_presentation_processor
advanced_filesystem_presentation_processor
slide_count, has_notes, author, title, subject, status
adfs_ai_embeddings
advanced_filesystem_ai_embeddings
quality, quality_flags, model, phash, ai_description, nsfw_label, nsfw_score
adfs_ai_transcription
advanced_filesystem_ai_transcription
fulltext, summary, tags, confidence, extractor_id, image_caption
adfs_metadata
advanced_filesystem_metadata
make, model, width, height, iso, datetime_original, gps_lat, gps_lon, extraction_status
Views integration (new)
- Each processor sub-module ships a
.views.incimplementinghook_views_data()(exposing itsadfs_*tables and fields) andhook_views_data_alter()(adding relationships tofile_managed). All processor tables are immediately available in Views without any configuration.
Content integrity
- Body reference rewriter — scans
text_long,text_with_summaryand link fields and rewrites hardcoded file URLs using the migration map. Supports relative + absolute URL variants in a single pass, all revisions, diagnose mode, and background processing via Drupal's Queue API. - Integrity check — verifies every
file_managedrow against disk. - Private file access — ties
private://access to the view permission of the referencing content entity. - Rollback — every migration writes a map row; roll back to original URIs at any time. Supports rollback by field, force overwrite, and date-range filters.
Developer experience
- Audit log — every destructive operation recorded with user, timestamp, target, result and JSON details.
- Symfony events — pre / post events for migrate, rollback, dedupe, rewrite, per-file retention, and per lifecycle action (
LifecycleActionAppliedEvent). - Self-diagnosis —
drush advfs:doctorruns a battery of checks and returns a non-zero exit code on failure. Perfect for CI / post-deploy pipelines. - Drush commands for every UI operation, scriptable for CI / CD.
Built-in path strategies
ID Label URI structuredefault
Drupal Default
Respects field directory tokens as Drupal core.
flat
Flat
[scheme]://flat/[filename]
flat_named
Flat (named folder)
[scheme]://[folder]/[filename]
counted
Counted Directory
Field dir + numbered buckets capped at a configurable max.
entity_bundle
Entity / Bundle
[scheme]://[entity_type]/[bundle]/[YYYY-MM/][filename]
cdn_hash
CDN-friendly content hash
[scheme]://[folder]/[aa]/[bb]/[hash].[ext] — immutable URLs.
date_hash
Date + partial hash
[scheme]://[folder]/YYYY/MM/[aa]/[bb]/[name--hash].[ext]
locale_path
Locale-aware
[scheme]://[langcode]/[field_dir/][filename]
content_type
Content type path
[scheme]://[folder]/[content_type]/[YYYY-MM/][filename]
user_role
User role path
[scheme]://[folder]/[role]/[YYYY-MM/][filename]
mime_type
MIME type path
[scheme]://[folder]/[images|video|audio|documents|archives|text|other]/[YYYY-MM/][filename]
year
Year path
[scheme]://[folder]/YYYY/[MM/][filename]
field_name
Field name path
[scheme]://[folder]/[field_name]/[YYYY-MM/][filename]
Ship your own strategy from any module using the @PathStrategy annotation — it is automatically picked up by the migration UI and all Drush commands.
Admin pages
Core module
- Dashboard —
/admin/reports/advanced_filesystem - Files report —
/admin/reports/advanced_filesystem/files - Migrate Files Strategy —
/admin/config/media/advanced_filesystem/strategy - Cron migration —
/admin/config/media/advanced_filesystem/cron-migration - Strategy simulator —
/admin/config/media/advanced_filesystem/simulator - Rollback —
/admin/config/media/advanced_filesystem/rollback - Rewrite embedded URLs —
/admin/config/media/advanced_filesystem/rewrite - Integrity report —
/admin/reports/advanced_filesystem/integrity
Deduplication sub-module
- Deduplicate files —
/admin/config/media/advanced_filesystem/dedupe - Visual similarity dedupe —
/admin/config/media/advanced_filesystem/perceptual-dedupe - Duplicate alerts —
/admin/config/media/advanced_filesystem/duplicate-alert
Cleanup sub-module
- Orphan & retention settings —
/admin/config/media/advanced_filesystem/orphan-settings - Dead image styles —
/admin/config/media/advanced_filesystem/dead-styles - Bulk delete orphans —
/admin/config/media/advanced_filesystem/bulk-delete-orphans - Ghost file scan —
/admin/config/media/advanced_filesystem/ghost-scan - Ghost file results —
/admin/config/media/advanced_filesystem/ghost-results - Filename sanitizer —
/admin/config/media/advanced_filesystem/sanitizer - File tools —
/admin/config/media/advanced_filesystem/file-tools
Reports sub-module
- Folder sizes —
/admin/reports/advanced_filesystem/folders - Storage growth —
/admin/reports/advanced_filesystem/storage-growth - File dependency graph —
/admin/config/media/advanced_filesystem/file-dependency - Private file access —
/admin/config/media/advanced_filesystem/private-access
File Quota sub-module
- Quota settings —
/admin/config/media/advanced_filesystem/quota - Quota dashboard —
/admin/reports/advanced_filesystem/quota - My Files —
/user/files
File Backup sub-module
- Dashboard —
/admin/config/media/advanced_filesystem/backup - Settings —
/admin/config/media/advanced_filesystem/backup/settings - Remote Sync —
/admin/config/media/advanced_filesystem/backup/remote-sync
Remote Sync sub-module
- Sync form —
/admin/config/media/advanced_filesystem/backup/remote-sync - API — list files (source server) —
/advanced-filesystem-remote-sync/list - API — serve file (source server) —
/advanced-filesystem-remote-sync/file
Upload Directory sub-module
- Settings —
/admin/config/media/advanced_filesystem/upload-directory - Browse files —
/admin/config/media/advanced_filesystem/upload-directory/browse - Browse by scheme —
/admin/config/media/advanced_filesystem/upload-directory/browse/{scheme}
AI Transcription sub-module
- Settings & extractor matrix —
/admin/config/media/advanced_filesystem/ai-transcription - Batch processing —
/admin/config/media/advanced_filesystem/ai-transcription/batch - Single file extraction —
/admin/content/files/{file}/semantic
AI Smart Image sub-module
- Settings —
/admin/config/media/advanced_filesystem/ai-smart-image - Batch processing —
/admin/config/media/advanced_filesystem/ai-smart-image/batch - Per-file form —
/admin/content/files/{file}/smart-filename
File Metadata sub-module
- Settings —
/admin/config/media/advanced_filesystem/metadata - Re-extract —
/admin/config/media/advanced_filesystem/metadata/reextract
AI Alt Text sub-module
- Settings —
/admin/config/media/advanced_filesystem/ai-alt-text - Batch generation —
/admin/config/media/advanced_filesystem/ai-alt-text/batch - Single file —
/admin/content/files/{file}/ai-alt-text
Smart Image sub-module
- Settings —
/admin/config/media/advanced_filesystem/smart-image - Derivative endpoint —
/adfs/image?src=…&<params></params> - Cache warm-up —
/admin/config/media/advanced_filesystem/smart-image/warmup
Lifecycle Manager sub-module
- Lifecycle policies —
/admin/config/media/advanced_filesystem/lifecycle - Add / edit policy —
/admin/config/media/advanced_filesystem/lifecycle/add - Lifecycle settings —
/admin/config/media/advanced_filesystem/lifecycle/settings - Run evaluation —
/admin/config/media/advanced_filesystem/lifecycle/run - Audit log —
/admin/config/media/advanced_filesystem/lifecycle/log - Legal hold list —
/admin/config/media/advanced_filesystem/lifecycle/legal-hold
LGPD/GDPR Auditor sub-module
- Settings —
/admin/config/media/lgpd-auditor/settings - Run scan —
/admin/config/media/lgpd-auditor/scan - Audit results —
/admin/config/media/lgpd-auditor/results
Antivirus sub-module
- Settings —
/admin/config/media/advanced_filesystem/antivirus - Detection log —
/admin/config/media/advanced_filesystem/antivirus/log - Bulk scan —
/admin/config/media/advanced_filesystem/antivirus/batch
Webhooks sub-module
- Endpoints & settings —
/admin/config/media/advanced_filesystem/webhooks - Delivery log —
/admin/config/media/advanced_filesystem/webhooks/log
AI Image Embeddings sub-module
- Settings —
/admin/config/media/advanced_filesystem/ai-embeddings - Clusters gallery —
/admin/config/media/advanced_filesystem/ai-embeddings/clusters - REST API —
/api/ai-embeddings/stats,/api/ai-embeddings/{file},/api/ai-embeddings/{file}/similar,/api/ai-embeddings/clusters
PDF Processor sub-module
- Per-file edit form —
/admin/content/files/{file}/pdf/edit - Merge form —
/admin/content/files/{file}/pdf/merge - Thumbnails —
/admin/content/files/{file}/pdf/thumbnails - Dashboard —
/admin/adfs/pdf/dashboard - Settings —
/admin/config/media/advanced_filesystem/pdf-processor - Derivative delete —
/{file}/pdf/derivative/{did}/delete(CSRF) - Derivative export —
/{file}/pdf/derivative/{did}/export - Dashboard clean —
/admin/adfs/pdf/dashboard/clean - Dashboard reprocess —
/admin/adfs/pdf/dashboard/reprocess
Video Processor sub-module
- Per-file edit form —
/admin/content/files/{file}/video/edit - Compare view —
/admin/content/files/{file}/video/compare - Dashboard —
/admin/adfs/video/dashboard - Settings —
/admin/config/media/advanced_filesystem/video-processor - Derivative delete —
/{file}/video/derivative/{did}/delete(CSRF) - Derivative export —
/{file}/video/derivative/{did}/export - Dashboard clean —
/admin/adfs/video/dashboard/clean - Dashboard reprocess —
/admin/adfs/video/dashboard/reprocess
Document Processor sub-module
- Per-file edit form —
/admin/content/files/{file}/document/edit - Merge form —
/admin/content/files/{file}/document/merge - Diff view —
/admin/content/files/{file}/document/diff - Dashboard —
/admin/adfs/document/dashboard - Settings —
/admin/config/media/advanced_filesystem/document-processor - Derivative delete —
/{file}/document/derivative/{did}/delete(CSRF) - Derivative export —
/{file}/document/derivative/{did}/export - Dashboard clean —
/admin/adfs/document/dashboard/clean - Dashboard reprocess —
/admin/adfs/document/dashboard/reprocess
Presentation Processor sub-module
- Per-file edit form —
/admin/content/files/{file}/presentation/edit - Settings —
/admin/config/media/advanced_filesystem/presentation-processor
Image Optimizer sub-module
- Settings —
/admin/config/media/advanced_filesystem/image-optimizer - Bulk optimize existing images —
/admin/config/media/advanced_filesystem/image-optimizer/batch - Optimization log —
/admin/config/media/advanced_filesystem/image-optimizer/log
Access Control sub-module
- Settings —
/admin/config/media/advanced_filesystem/access - Access Log —
/admin/config/media/advanced_filesystem/access/log - Secure download endpoint —
/adfs/download/{fid}/{token}?expires={ts}
CDN Integration sub-module
- Settings —
/admin/config/media/advanced_filesystem/cdn - Cache Purge —
/admin/config/media/advanced_filesystem/cdn/purge - Purge Log —
/admin/config/media/advanced_filesystem/cdn/purge-log
Drush commands
- advanced_filesystem:migrate-files — migrate all files (or one field's files) with optional
--strategy,--delete,--dry-run. - advanced_filesystem:rewrite (alias
afr) — rewrite embedded URLs in long-text and link fields. Options:--dry-run,--all-revisions,--entity-type,--field,--list. - advanced_filesystem:check-orphans — force orphan check, bypassing cron throttle.
- advanced_filesystem:run-retention — force retention pass:
--dry-run,--list,--list-rules. - advanced_filesystem:rollback — revert migrations:
--since,--until,--dry-run,--force,--rewrite-bodies. - advanced_filesystem:dedupe — compute hashes and merge duplicate groups.
- advanced_filesystem:check-integrity — verify every
file_managedrow against disk. - advanced_filesystem:folder-report — recursive size / extension breakdown of a stream wrapper.
- advanced_filesystem:doctor (alias
advfs:doctor) — self-diagnosis; exit 1 on FAIL (or WARN with--strict). - lifecycle:run — trigger lifecycle policy evaluation immediately.
- lifecycle:status — display per-policy statistics (archived, deleted, errors, last processed).
- lifecycle:reset-stats — reset per-policy counters in State.
- metadata:extract — queue all eligible files for metadata extraction.
- metadata:status — show extraction queue depth and per-status file counts.
- adfs:ai:transcribe — run semantic extraction on a single file. Options:
--overwrite,--language. - adfs:semantic:extract — run the full semantic pipeline on one file.
- adfs:ai:batch (alias
adfs-ai-batch) — queue files for semantic extraction. Options:--limit,--overwrite,--status. - adfs:semantic:status — show all
adfs_ai_*field values for a file. - adfs:semantic:list-extractors — list all discovered
@SemanticExtractorplugins. - adfs:ai:retry — re-queue all files with
failedextraction status. - adfs:ai:stats — print extraction status counters.
- adfs:alt-text:generate (alias
adfs-alt) — generate alt text in bulk. Options:--nid,--term-id,--entity-type,--bundle,--field-name,--overwrite,--chunk. - adfs:image:derive — pre-generate a single Smart Image derivative. Options:
--w,--h,--fmt,--preset. - adfs:image:prebuild — pre-generate derivatives for all managed image files.
- adfs:image:purge — delete all files in the derivatives cache directory.
- adfs:image:stats — report derivatives cache directory size and file count.
- adfs:image:token — generate an HMAC token for a signed Smart Image URL.
- adfs:image:warmup — warm the Smart Image derivative cache for all managed images. Options:
--preset,--widths,--fmt,--fit,--limit,--mime. - adfs:image-optimizer:run (alias
adfs-opt) — bulk-optimize existing managed images (re-encode / resize / strip metadata / WebP). Options mirror the optimizer settings. - adfs:image-optimizer:stats (alias
adfs-opt-stats) — report optimization log totals and bytes saved. - adfs:ai-emb:index — index all eligible image files for visual embeddings. Options:
--limit. - adfs:ai-emb:ai-enrich — run AI semantic enrichment on indexed images. Options:
--limit. - adfs:ai-emb:stats — print embedding coverage and AI enrichment counts.
Requirements
- Drupal 10, 11, or 12
- PHP 8.1+
- The file module (core)
- Drush 12+ — optional, for CLI commands
- A working MailManager for email notifications
- A configured private filesystem for quarantine and private file access
- PHP GD extension — required for image metadata stripping, perceptual hashing, Smart Image derivatives, and AI alt text image preprocessing
- PHP fileinfo extension for MIME-based metadata extraction
- drupal/ai module — required by
advanced_filesystem_ai_transcriptionandadvanced_filesystem_ai_alt_text; configure AI providers at Admin → Config → AI → AI Settings - ffmpeg — optional, required for video transcription in
advanced_filesystem_ai_transcription - poppler-utils (
pdftotext,pdftoppm,pdfimages) — optional; required byadvanced_filesystem_pdf_processorfor text extraction and image extraction from PDFs - Ghostscript (
gs) — required byadvanced_filesystem_pdf_processor(compress, thumbnail, watermark, PDF/A, resize, rotate) andadvanced_filesystem_presentation_processor(slide PNG export) - LibreOffice (
soffice) — required byadvanced_filesystem_document_processorandadvanced_filesystem_presentation_processorfor format conversion - Tesseract OCR (
tesseract) — optional; required byadvanced_filesystem_pdf_processorfor the OCR operation tab - drupal:media module (core, enabled by default) — required by all four processor sub-modules for Media Source Plugin API support
Installation
composer require drupal/advanced_filesystem drush en advanced_filesystem -y drush updb drush cr
The four core sub-modules are automatically enabled on install. Enable the additional sub-modules separately when needed:
# File management drush en advanced_filesystem_backup -y drush en advanced_filesystem_remote_sync -y drush en advanced_filesystem_upload_directory -y drush en advanced_filesystem_lifecycle_manager -y drush en advanced_filesystem_metadata -y # Security & compliance drush en advanced_filesystem_antivirus -y drush en advanced_filesystem_lgpd_gdpr -y drush en advanced_filesystem_access -y # Delivery & integration drush en advanced_filesystem_cdn -y drush en advanced_filesystem_webhooks -y # Image processing drush en advanced_filesystem_smart_image -y drush en advanced_filesystem_image_optimizer -y # AI features drush en advanced_filesystem_ai_transcription -y drush en advanced_filesystem_ai_alt_text -y drush en advanced_filesystem_ai_smart_image -y drush en advanced_filesystem_ai_embeddings -y # File processors (require drupal:media) drush en advanced_filesystem_pdf_processor -y drush en advanced_filesystem_video_processor -y drush en advanced_filesystem_document_processor -y drush en advanced_filesystem_presentation_processor -y
Donation Support
This project took significant time to develop. If it has helped you save time in your work or business, feel free to contribute any amount you consider fair to support its continued development