<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>File Upload</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"> <style> body { font-family: Arial, sans-serif; margin: 50px; } .form-container { max-width: 500px; margin: auto; padding: 20px; border: 1px solid #ccc; border-radius: 5px; } .form-group { margin-bottom: 15px; } .form-group label { display: block; margin-bottom: 5px; } .form-group input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; } .form-group button { padding: 10px 20px; background-color: #28a745; color: white; border: none; border-radius: 5px; cursor: pointer; } .form-group button:hover { background-color: #218838; } .flash-message { margin-bottom: 15px; padding: 10px; border-radius: 5px; } .flash-message.error { background-color: #f8d7da; color: #721c24; } .flash-message.success { background-color: #d4edda; color: #155724; } </style> </head> <body> <div class="form-container"> <h2>Upload File</h2> {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %} <div class="flash-message {{ category }}">{{ message }}</div> {% endfor %} {% endif %} {% endwith %} <form method="POST" enctype="multipart/form-data"> <div class="form-group"> <label for="file">Choose file</label> <input type="file" id="file" name="file"> </div> <div class="form-group"> <button type="submit">Upload</button> </div> </form> </div> </body> </html>