🚀 Need a ready-to-deploy version?
Includes Docker, setup guide, sample responses, and full API structure.
An extended version of a file upload API built with Flask. Supports uploading multiple file types including images, PDFs, text files, and even audio (MP3). Returns the filename and access URL upon successful upload.
- 📤 Upload files via HTTP POST (
/upload) - 🧾 Supports
.png,.jpg,.jpeg,.pdf,.txt,.mp3 - 🧼 Filenames auto-renamed using UUIDs
- 🧱 Files saved under
uploads/folder - 🔒 Max file size: 15MB
- 🐳 Dockerized & modular structure
POST /upload
Request (form-data):
file: your file
Success Response:
{
"filename": "uuid_filename.mp3",
"url": "/uploads/uuid_filename.mp3"
}{ "error": "No file part in the request" }
{ "error": "No selected file" }
{ "error": "Invalid file type" }pip install -r requirements.txt- Flask
- Werkzeug
python app.pyServer runs at:
http://127.0.0.1:5000/
docker build -t file-upload-api .
docker run -p 5000:5000 file-upload-api- ✅ Upload
.mp3,.jpg,.pdf ⚠️ Error responses- 🖥 Console logs + file saved in
/uploads
All screenshots saved in
/screens/
Includes full project with Dockerfile and modular structure:
- Email: talabov.ali72@gmail.com
- Telegram: @talabovali
Need this in another language/stack (Node.js, Go, etc)?
Custom dev available — just reach out.