Skip to content

Bence542409/php-fileserver

Repository files navigation

php-fileserver

PHP file management system with directory listing.


Built by me and ChatGPT.

You have to determine a subfolder name in certain files before using (default: server1)

The files are in Hungarian, but you can change it as you like.

The fileserver works with my gallery system and my

If PHP is not yet installed on your web server: https://www.php.net/downloads.php


php/index_dir.php -->

  • lists the files available in the directory of the include file (filename, creation date, modification date, type, download icon)
  • reads the path of the directory without the unnecessary parts of the url (if directory is not root)
  • reads the name of the directory (if directory is root)
  • hides itself and other system files
  • opens picture, video, pdf and php files in browser
  • option to browse between folders and files in the directory
  • counts the number of files (only on desktop view)
  • press the search-all icon or the 'S' key to search in all subdirectories (only on desktop view)
  • press the download-folder icon or the 'D' key (while no records are selected) to download all the files in the directory (only on desktop view)
  • press the share-folder icon or the 'C' key to copy the path to the directory (only on desktop view)
  • press the link icon to create a shareable link. (only on desktop view)
  • press the login icon or the 'L' key to log in as admin (only on desktop view)
  • press the logout icon or the 'Q' key to log out (only on desktop view)
  • press the file-create icon or the 'N' key to create a file/folder (only on desktop view)
  • press the file-upload icon or the 'U' key to upload a file (unzips the file if the file is a .zip archive) (only on desktop view)
  • press the download-folder button or the 'D' key (while records are selected) to download files or folders individually (if the file is a directory, it makes a .zip archive of the folder before downloading)
  • press the share-file icon or the 'C' key (while a record is selected) to copy the path to the file
  • press the edit button or the 'E' key (while records are selected) to edit the contents of the selected file
  • press the rename button or the 'R' key (while records are selected) to rename the selected file/folder
  • press the move button or the 'M' key (while records are selected) to move the selected file/folder to another location
  • press the delete button or the "delete" key (while records are selected) to delete the selected file(s)/folder(s)
  • press the "backspace" key to go to the previous page (while textbox is inactive)
  • use the arrow keys to move between records
  • press the "enter" key to focus the search input (while textbox is inactive and no records are selected)
  • press the "enter" key to open the first result of search (while textbox is active and no records are selected)
  • press the "enter" key to open that specific record (while records are selected)
  • press the "esc" key to defocus the search input and selected records (while textbox is active and/or records are selected)
  • press the "esc" key to go to the parent directory (while textbox is inactive)
  • press the "tab" key to reset the search input
  • press the numeric keys (1 - 9) to open the numbered result of the search (while textbox is inactive)
  • press the '0' key to go to the parent directory (while textbox is inactive)

php/login.php -->

  • promts the user to login in (default password: admin)
  • unlocks root access in search.php and download.php
  • grants access to admin.php
  • grants admin privilages to index_dir.php

php/logout.php -->

  • logs out the user when opened

php/download.php -->

  • reads the file path to a file or folder from a specific directory, and downloads it from one directory above (if the file is a directory, it makes a .zip archive of the folder before downloading)
  • if the download resource is not in an allowed filepath, redirects to login.php (if user is not already authenitcated)

php/admin.php -->

  • redirects to login.php (if user is not already authenitcated)
  • gives you the option to upload, rename or delete files and create or delete (only empty) directorys
  • unzips the file after uploading, if the file is a .zip archive

php/upload.php -->

  • option to upload files anonymously to a given directory

php/search.php -->

  • option to search in allowed filepaths
  • button to log in using login.php to gain root access

index_include.php -->

  • refers to the code (php/index-dir.php) using its own directory

.htaccess -->

  • redirects example.com to example.com/server1/
  • redirects example.com/admin to example.com/server1/php/admin.php
  • redirects example.com/search to example.com/server1/php/search.php
  • redirects example.com/upload to example.com/server1/php/upload.php
  • redirects example.com/login to example.com/server1/php/login.php
  • redirects to example.com/server1/php/download.php?$1 if the URL starts with /download/
  • redirects to example.com/server1/photo/%1/colored/ if the URL starts with a number (to work with my php gallery system)

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages