Add 'Image Upload' Feature
Each user can upload image to the system. The images from different users where be separated.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<li>Integrating with Bootstrap</li>
|
||||
<li>Interaction with Database (SQLite)</li>
|
||||
<li>Invoking static resources</li>
|
||||
<li>Upload files</li>
|
||||
</ul>
|
||||
|
||||
<p>For more basic knowledge of Flask, you can refer to <a href="https://www.tutorialspoint.com/flask/">a tutorial on Tutorialspoint</a>.</p>
|
||||
|
||||
6
templates/page_413.html
Normal file
6
templates/page_413.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block page_title %}Request if too big(413){% endblock %}
|
||||
{% block body %}
|
||||
{{ super() }}
|
||||
Please check the file size you're uploading.
|
||||
{% endblock %}
|
||||
@@ -43,4 +43,32 @@
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
<hr>
|
||||
<h3>Upload Image</h3>
|
||||
<form method='post' action='/upload_image' enctype=multipart/form-data>
|
||||
<p><input type=file name=file>
|
||||
<input type=submit value=Upload>
|
||||
</form>
|
||||
|
||||
{% if images %}
|
||||
<h3>Your Images</h3>
|
||||
<table class="table small">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Image ID</th>
|
||||
<th>Timestamp</th>
|
||||
<th>Image Name</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% for image_id, timestamp, image_name in images %}
|
||||
<tr>
|
||||
<td> {{ image_id }} </td>
|
||||
<td> {{ timestamp }} </td>
|
||||
<td> {{ image_name }} </td>
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user