How rumjerr/fileserver works
fileserver is a browser-based remote file manager. A user works through the browser UI; HTTP handlers in the server validate paths and dispatch file operations, previews, trash actions, and storage reporting. The implementation layer in mainfunctions.cpp performs filesystem work, HEIC conversion, trash retention, and storage calculations. The README documents the product capabilities, but the frontend’s API wiring is not shown in the excerpts; that connection is marked unverified. The server’s mounted directory is ./www, which is not present in the supplied tree.
Main entry points: main.cpp API routes · mainfunctions.cpp Trash and restore · index.html File manager UI · httplib.h HTTP server library
Components 14
Browser interface
- File manager UI
index.html
HTTP server
- API routes
main.cpp - HTTP server library
httplib.h - JSON support
json.hpp
File operations
- Safe path handling
mainfunctions.cpp - Directory listing
mainfunctions.cpp - Upload and download
mainfunctions.cpp - Rename and move
mainfunctions.cpp - HEIC preview conversion
mainfunctions.cpp - Image output helper
stb_image_write.h
Trash and insights
- Trash and restore
mainfunctions.cpp - Storage reporting
mainfunctions.cpp
Other components
- Remote user
- Server filesystem
Connections 19
- Remote user → File manager UI: uses
README.md - File manager UI → API routes: requests API
- API routes → HTTP server library: registers routes
main.cpp - API routes → JSON support: serializes results
main.cpp - API routes → Safe path handling: validates paths
main.cpp - API routes → Directory listing: lists entries
main.cpp - API routes → Upload and download: reads and writes
main.cpp - API routes → Rename and move: renames and moves
main.cpp - API routes → HEIC preview conversion: converts previews
main.cpp - API routes → Trash and restore: dispatches trash actions
main.cpp - API routes → Storage reporting: requests usage stats
main.cpp - API routes → Trash and restore: schedules expiry cleanup
main.cpp - Safe path handling → Server filesystem: resolves paths
- Directory listing → Server filesystem: reads entries
- Upload and download → Server filesystem: reads and writes
- Rename and move → Server filesystem: moves and renames
- Trash and restore → Server filesystem: stores and restores
- Storage reporting → Server filesystem: measures usage
- HEIC preview conversion → Image output helper: encodes JPEG
mainfunctions.cpp