Skip to content

R0mb0/Ckfinder_file_validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ“¦ Ckfinder file validator πŸ›‘οΈ

A privacy-first, client-side web tool built with vanilla JavaScript to validate, repair, and standardize files before uploading them to strict server parsers (like CKFinder). It actively rebuilds PDFs, sanitizes images, and standardizes archives completely offline. No server uploads, zero privacy risks.


Codacy Badge pages-build-deployment Maintenance Open Source Love svg3 MIT Donate

00.png


πŸš€ Features

  • 100% Privacy-First: Everything happens locally in your browser. Sensitive documents and personal images are never uploaded to any external server.
  • Deep PDF Repair & Rebuild: Bypasses strict CMS filters by fixing corrupted %PDF- headers, missing %%EOF markers, and completely rewriting the document's internal structure using pdf-lib.
  • Image Sanitization: Automatically re-encodes images (JPG, PNG, WEBP) using the HTML5 Canvas API, effectively stripping out corrupted headers, hidden EXIF metadata, and embedded malicious payloads.
  • Archive Standardization: Opens and regenerates Office documents (DOCX, XLSX) and ZIP archives using JSZip to guarantee perfectly standard headers that no parser will reject.
  • Batch Processing & ZIP Export: Drag and drop dozens of mixed files at once. The app sanitizes them all simultaneously and lets you download the safe, fixed files in a single .zip archive.
  • Modern UI/UX: Built with Tailwind CSS, featuring smooth animations, intuitive drag-and-drop support, and an adaptive Light/Dark mode based on system preferences.

πŸ› οΈ How it works

  1. Drag and drop your files into the designated dropzone.
  2. The app analyzes the file extension and routes it to the specific processing engine.
  3. For PDFs: It reads the raw binary data (Uint8Array) to search for magic bytes. If the structure is corrupted or contains junk bytes, it slices the buffer, extracts the core data, and performs a "Save As" equivalent in memory to generate a mathematically clean PDF.
  4. For Images: It draws the image onto an invisible, off-screen <canvas> and exports it back to a Blob. This native browser feature natively drops any non-pixel data (like EXIF or payloads).
  5. For Archives/Office Docs: It parses the file structure and repackages the entire archive byte-by-byte to ensure header integrity.
  6. The app generates local Blob objects and displays the outcome in a detailed results table, ready for individual or bulk download.

πŸ† What makes it special?

  • Strict Parser Bypass: Many tools (like Adobe Acrobat) or libraries read PDFs tolerantly but fail to fix the underlying structure. This tool forcefully standardizes files so that incredibly strict backend parsers (like CKFinder) will always accept them.
  • Zero Server Bottlenecks: By running entirely client-side, there are no file size limits, no upload timeouts, and absolutely zero hosting costs for backend file processing.

πŸ’‘ Why use this tool?

  • Webmasters & Content Managers: Stop dealing with frustrating "Invalid file" or "Upload failed" errors when trying to upload user-provided documents to your CMS via CKFinder.
  • Security-Conscious Users: Effortlessly strip tracking metadata and EXIF data from your photos before sharing or uploading them online.
  • Everyday Users: Quickly repair corrupted PDF files that refuse to open or behave strangely in standard document viewers.

⚑ Getting Started

Online

Simply visit the Live Demo hosted on GitHub Pages.

Local Installation (Fully Offline)

Running this tool locally without the internet is extremely easy:

  1. Clone this repository or download the source code ZIP.
  2. Ensure the required core libraries are in the same folder as the HTML file (tailwindcss.js, pdf-lib.min.js, jszip.min.js, and Phosphor Icons if used locally).
  3. Double-click index.html to open it in your favorite browser.
  4. Start validating and sanitizing!

πŸ™ Credits & Inspiration

  • pdf-lib: The heavy lifter for parsing and mathematically rebuilding PDF structures from scratch in the browser.
  • JSZip: For seamlessly reading and standardizing ZIP and Office document headers.
  • Tailwind CSS: For making the UI modern, responsive, and a joy to build.
  • Phosphor Icons: For the beautiful, clean icons used throughout the interface.
Not made by AI

About

A batch tool to validate and prepare files for strict parsers like CKFinder. It passes regular files through while actively detecting and structurally rebuilding corrupted PDFs.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Contributors