A simple, lossless file hosting service with a Flask backend and React frontend. Exposeable REST API for uploads and retrieval.
- Upload any file type and get shareable URLs
- Lossless storage (original quality preserved)
- No authentication required
- Public access for all files
- Exposeable API:
GET /apifor discovery,POST /api/uploadfor uploads - Support for all file formats (including video, audio, documents, images, and archives)
- Max file size: 50MB
imageServer/
├── app.py # Flask backend
├── requirements.txt # Python dependencies
├── Procfile # Railway deployment config
├── railway.json # Railway configuration
├── runtime.txt # Python version
├── RAILWAY_DEPLOY.md # Backend deployment guide
├── VERCEL_DEPLOY.md # Frontend deployment guide
└── frontend/
├── index.html # Main page
├── style.css # Styling
├── script.js # Upload logic
└── vercel.json # Vercel configuration
# Install dependencies
pip install -r requirements.txt
# Run the server
python app.pyBackend runs on http://localhost:5000
Open frontend/index.html in a browser, or use a local server:
cd frontend
python -m http.server 8000Frontend available at http://localhost:8000
Important: Update API_URL in frontend/script.js to point to your backend URL.
See RAILWAY_DEPLOY.md for detailed instructions.
See VERCEL_DEPLOY.md for detailed instructions.
- User uploads any file via the frontend (or any client via the API)
- Client sends the file to
POST /uploadorPOST /api/upload - Backend saves the file with a unique UUID filename
- Backend returns a public URL
- User can share the URL; files are served via
GET /files/<filename>(old/images/<filename>URLs redirect to/files/for backward compatibility)
External clients can use the API without the web UI.
API discovery: returns endpoints, allowed types, and usage.
Response (example):
{
"name": "Image & File Hosting API",
"version": "1.1",
"base_url": "https://your-backend.railway.app",
"endpoints": {
"upload": { "method": "POST", "path": "/api/upload", ... },
"get_file": { "method": "GET", "path": "/files/<filename>", ... }
},
"allowed_types": ["*"]
}Upload any file type.
Request: multipart/form-data with file field (max 50MB)
Response:
{
"success": true,
"url": "https://your-backend.railway.app/files/abc123.pdf",
"filename": "abc123.pdf"
}Retrieve any uploaded file.
Response: File with appropriate Content-Type
Redirects to /files/<filename>. Kept so old shared links still work.
PORT- Port to run the server (automatically set by Railway)UPLOAD_FOLDER- Directory to store uploads (set to/app/uploadson Railway)S3_OBJECT_PREFIX- Optional S3 folder/prefix for new uploads (default:compliance). Reads stay backward-compatible with existingcompliance/objects.
- Files are stored with no conversion (lossless/original)
- Files are renamed with UUID to prevent conflicts
- CORS is enabled for all origins
- Railway volumes ensure persistent storage across deployments
- Use
GET /apifrom scripts or tools to discover the API programmatically