Skip to content

v2.0.2

Latest

Choose a tag to compare

@sean1138 sean1138 released this 19 Dec 20:38

image

we have pagination now!


Features

  1. Supports Multiple Users

    • There is a user-creds PHP file that you need to manually enter in user data
    • Rudimentary user role system (admin, editor, viewer) setup but not used for any functionality... yet?
  2. File Upload Functionality

    • Users can upload various file types: images, text files, PDFs, videos, and audio files.
    • Allowed file types can be configured in config.php.
    • Files are stored in a specific directory (uploads/ by default) set in config.php.
  3. Dynamic File Viewer

    • Clicking on a file "card" opens a dialog/modal to view the file larger.
    • Supported file types:
      • Images: JPEG, JPG, PNG, GIF displayed in <img> tags.
      • Text Files: Displayed in a <pre> tag with fetch to load the content.
      • PDF Files: Rendered in an <iframe> with a "Fit Height" view (#view=FitH).
      • Videos: MP4, WebM, MOV, MPEG played using a <video> element.
      • Audio: MP3 played using an <audio> element.
    • Unsupported file types display a simple "Preview not available for .ext files" message.
    • Relies on uploads/log.json for data retrieval.
    • >>>>----> NEW in 2.0.2 Pagination along with control for items per page: 8 (default), 16, 32, 64, all.
  4. Dynamic Path Management

    • A $uploadUrl variable dynamically manages the web path to files (e.g., uploads/).
    • Should be pretty portable - works in subdirectories without relying on hard-coded absolute paths.
  5. File Metadata

    • Cards display file-specific details, such as:
      • Filename
      • Filesize
      • Dimensions
      • Upload date
    • Metadata is passed as data attributes (data-filename, data-filesize, etc.) for easy JavaScript access.
  6. Responsive and Accessible UI

    • Semantic HTML and data attributes improve accessibility.
    • Modal/dialog uses <dialog> for better accessibility and focus management.
    • Cards are navigable via keyboard (tabindex), modal/dialog via arrow keys.

Remaining Notes

This project has spiraled into a versatile, user-friendly file uploader and viewer, capable of handling most common file types with previews. The uploader page itself still needs to properly handle displaying non-image file types.