π Need a ready-to-deploy version?
Includes Docker, setup guide, sample responses, and full API structure.
π Buy it on Gumroad
A Flask-based API that handles secure file uploads and performs file type validation. Designed for lightweight virus scanning pipelines β ClamAV integration placeholder included.
- π€ Upload files via POST
- π§ Validate file types (only allow safe MIME types)
- β Reject dangerous file extensions (e.g.,
.exe
,.bat
) - π Max upload size: 5MB
- π§ͺ Modular Flask structure with endpoints in
routes/
- π³ Docker-ready
POST /upload
Request (form-data):
file
: any file (txt, pdf, docx, xlsx, png, jpg)
Responses:
β Success:
{
"filename": "report.pdf",
"status": "unknown",
"details": "Virus scan skipped (ClamAV not available)"
}
β Errors:
{ "error": "No file part" }
{ "error": "No selected file" }
{ "error": "File type not allowed" }
{ "error": "Forbidden file type" }
{ "error": "Error occurred while processing file." }
pip install -r requirements.txt
- Flask
python app.py
Server runs at:
http://127.0.0.1:5000/
Or with Docker:
docker build -t file-upload-virus-api .
docker run -p 5000:5000 file-upload-virus-api
- β Successful upload
- β File type rejected
- π Upload error simulation
See
/screens/
for Postman previews
You can get a ZIP with full code, Dockerfile, and documentation:
π Buy it on Gumroad
- Email: [email protected]
- Telegram: @talabovali
Need this in another language/stack (Node.js, Go, etc)?
Custom dev available β just reach out.