Skip to main content

Files Gallery 0.9.0

· 6 min read
Karl Ward
Creator

Files Gallery 0.9.0 now includes a complete file manager with file selection, multi-file actions and drag-and-drop. This release took much longer than anticipated, because I had to refactor the entire PHP codebase to support all the new file manager features.

See demo Release info for Files Gallery 0.8.0

Complete File Manager

While previous versions only had basic features, Files is now a complete file manager.

  • New actions move, copy, zip and unzip.
  • File selection with multi-file actions.
  • Drag-and-drop single or multiple selected files into dirs (move or copy).
  • Keyboard copy-paste selected items from one directory into another.
  • Mass-download selected items (will also download files and folders recursively).
  • Mass-copy links for selected items (for example to paste into emails).
  • Duplicate single or multiple items, including directories.
  • Keyboard shortcuts for delete, copy-paste, rename, select all and duplicate.
  • Quick access to new buttons [new file], [new folder] and [upload] for current dir.

Refactored PHP codebase

With this release, it was necessary to clean up and refactor the entire PHP codebase in support of new file manager features and future implementations. All code is now sorted neatly into classes with extensive comments for improved readability. Useful for those who want to review the code and understand what goes on.

See index.php on Github

More Features

  • New shuffle (random) sort order [forum][forum]
  • Uploader will now keep folder structure for drag-and-drop folder uploads [forum]
  • New Uppy uploader compressor option retainExif enabled by default [forum]
  • Video files will now loop and attempt to autoplay by default [forum]
  • Javascript popup option video_autoplay replaces video_autoplay_clicked
  • Click current dir in breadcrumbs will open contextmenu for current dir.
  • Mouse pointer is now hidden in popup on mouse idle (3 seconds) [forum]
  • Photo Exif date will now display without client timezone offset [forum][forum]
  • New languages Finnish, Turkish, Greek, Indonesian, Slovenian and Ukrainian.
  • Assign transparency background color for resized images in index.php [Github]
  • Config storage_path can now be false (prevents cache and external config).
  • Create config.php and storage dirs with ?action=tests without running the app.
  • All downloads are now recursive (download includes all files in all subfolders).
  • Symlinks now display file name instead of resolved symlink target [forum]
  • We now load symlink file paths directly in browser instead of via PHP proxy [forum]
  • Config option check_updates renamed to allow_check_updates
  • Increased default image_resize_memory_limit from 128 to 256.
  • Increased default image_resize_max_pixels from 30000000 to 60000000.
  • ?check=1 tests are now accessed from ?action=tests
  • URL shortcut files will now show file name without extension [forum][forum]

New config options

The following new PHP config options have been added.

_files/config/config.php
'allow_download' => true, // allow various download features / When disabled, PHP download functions will be blocked also
'allow_zip' => false, // allow compressing selected files to zip archive / requires PHP ZipArchive
'allow_unzip' => false, // allow extract selected zip file / requires PHP ZipArchive
'allow_move' => false, // allow moving files and folders between directories
'allow_copy' => false, // allow copying files and dirs between directories
'allow_mass_download' => false, // allow mass download files and folders / This needs to be enabled if you want to be able to download dir or multiple selected files // when disabled PHP multi-file download functions are disabled also
'allow_mass_copy_links' => false, // allow mass-copy links to selected files
'allow_check_updates' => false, // allows the app to check for updates
'allow_tests' => true, // allow url ?action=tests to disagnose server, PHP and config for Files Gallery compatibility

New Javascript options

The following new Javascript options have been added.

_files/css/custom.js
_c.config = {
localStorage_cache: true, // disable folders from being stored in browser localStorage cache
javascript_cache: true, // disable folders from being stored in Javascript cache
preview_image_cache: true, // normal behavior when true, but force-reload from server if set to false
download_dir: {
// ...
recursive: true, // attempt to fetch files recursively via PHP / does not work with zip via server/PHP
max_filesize: 2000000000, // block download when filesize exceeds this value / default ~ 2000 MB ~ 2GB
prompt_filesize: 100000000, // display download prompt when filesize exceeds this value / default ~ 100 MB
},
filemanager: {
path_selector_root_value: '.', // indicates root (home) dir in dropdown target selector
path_selector_root_label: '', // if empty, we will use default `🏠 ${ lang.get('home', true) }`
prompt: {
delete: true, // could be off, but better safe than sorry / overrides to false on drag to trashcan
duplicate: true, // could be off, in which case duplicate names are created automatically
copy: true, // always true, except when this.show_prompt is assigned from drag.js
move: true, // always true, except when this.show_prompt is assigned from drag.js
new_file: true, // could be off, but would create unique file name automatically
new_folder: true, // could be off, but would create unique file name automatically
rename: true, // always on
unzip: true, // could be off, in which case it will unzip to current dir
zip: true, // could be off, in which case it will zip to incrementing name 'Archive.zip' or 'file.txt.zip' (single file)
}
},
select: {
enabled: true, // disable select bar entirely
buttons: ['move', 'copy', 'duplicate', 'zip', 'unzip', 'delete', 'copy links', 'download', 'rename'], // select buttons and order
mode: false, // select mode is disabled by default
mode_button: true, // show select mode toggle button in topbar
display: 'select-mode', // 'select-mode', // select, fixed, select-mode, always
copy_links_separator: ', ', // '\n', ', ', ' ' / link separator when mass-copying links
keyboard_shortcuts: ['a', 'i', 'c', 'v', 'n', 'Backspace', 'd'] // keyboard shortcuts enabled
},
drag: {
enabled: true, // drag-and-drop is enabled
prompt: false, // don't prompt on drag-and-drop because action is does not require confirmation
copy: true, // allow copy on drag-and-drop (normally keyboard-cmd/ctrl while dropping files)
delete: false, // drag selected files to trashcan / disabled because it doesn't seem useful
move: true // allow move (default drag and drop)
}
}

How to update?

Simply download latest Files Gallery index.php or see the update docs.


Next up: Users 🔒📁🫱‍🫲

I know many of you are waiting for multi-user login capabilities, with different users and permissions, as well as login and non-login versions. This will be a priority for next release, which I will start shortly, and which should take much less time to complete than the 0.9.0 release.