httpshare
httpshare is a powerful web-based file manager written in Go. It allows you to quickly share, browse, and manage files over HTTP with minimal setup.
Features
File Management
- ๐ค File Upload: Upload files directly from your browser
- ๐๏ธ Delete: Remove files and folders with confirmation
- โ๏ธ Rename: Rename files and directories
- ๐ Create Folders: Create new directories on the fly
Browsing & Organization
- ๐ Search: Real-time search for files and folders
- ๐ค Sorting: Sort by name, size, or modification date
- ๐ File Information: View file size, modification time, and permissions
- ๐ผ๏ธ Image Preview: Automatic thumbnail display for images
Content Preview
- ๐๏ธ File Preview: Preview text files, PDFs, videos, and audio files directly in the browser
- ๐ Markdown Rendering: View
.md files with full formatting, syntax highlighting, and styling
- ๐ผ๏ธ Gallery Mode: Browse images with a beautiful slideshow interface
- Navigate with arrow keys or on-screen buttons
- Click any image to open it in gallery mode
- View image counter and filename
- Support for:
.txt, .md, .log, .json, .xml, .csv, .pdf, .mp4, .webm, .mp3, .wav
Interface
- Lightweight and easy to use
- Modern, responsive web interface with dark theme
- Mobile-friendly design
- Configurable port
- Simple web interface for browsing and downloading files
- Configurable port and directory
- Cross-platform: works on Windows, Linux, and macOS
Installation
Make sure you have Go installed. Then, run:
go install gitlab.com/isa0/httpshare@latest
This installs the httpshare binary in your Go bin directory (usually $GOPATH/bin).
Usage
**Start the file explorer with the following command:
httpshare [--port <port>] [--directory <path>]
Options
--port: Set the port to serve the files (default: 8080)
--directory: Specify the directory to serve (default: current directory)
--log: Write logs into a file (default: disabled)
Then, open your web browser and navigate to:
http://localhost:<port>
You will see a modern web interface to browse, manage, and preview files in the current directory.
API Endpoints
The application provides RESTful API endpoints for programmatic access:
- POST
/api/upload - Upload files
- DELETE
/api/delete?path=<path> - Delete files/folders
- POST
/api/rename - Rename files/folders
- POST
/api/mkdir - Create new directory
- GET
/api/search?q=<query>&path=<path> - Search files
Example: Upload a file using curl
curl -F "file=@myfile.txt" -F "path=." http://localhost:8080/api/upload
Example: Delete a file
curl -X DELETE "http://localhost:8080/api/delete?path=myfile.txt"
You will see a simple web interface to explore and download files in the specified directory.
Example
Serve files from /home/user/Documents on port 3000:
httpshare --port 3000 --directory /home/user/Documents
Contributing
Contributions are welcome! Feel free to submit issues or merge requests.
License
This project is licensed under the MIT License.