Repository navigation
we have pagination now!
Features
-
Supports Multiple Users
- There is a
user-credsPHP 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?
- There is a
-
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 inconfig.php.
-
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 withfetchto 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.
- Images: JPEG, JPG, PNG, GIF displayed in
- Unsupported file types display a simple "Preview not available for .ext files" message.
- Relies on
uploads/log.jsonfor data retrieval. - >>>>----> NEW in 2.0.2 Pagination along with control for items per page: 8 (default), 16, 32, 64, all.
-
Dynamic Path Management
- A
$uploadUrlvariable dynamically manages the web path to files (e.g.,uploads/). - Should be pretty portable - works in subdirectories without relying on hard-coded absolute paths.
- A
-
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.
- Cards display file-specific details, such as:
-
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.
