Get HTML response from AJAX
-Click the refresh button to get the HTML response.
-The response may randomly be a voluntary error so you should try it more than once.
- Refresh: -diff --git a/tetawebapp/static/styles/tetawebapp.css b/tetawebapp/static/styles/tetawebapp.css
index fca02ad..2f57c9b 100644
--- a/tetawebapp/static/styles/tetawebapp.css
+++ b/tetawebapp/static/styles/tetawebapp.css
@@ -155,6 +155,12 @@ main > article > ol {
text-justify: distribute;
}
+main > hr {
+ border-color: var(--mid-bg);
+ border-style: solid;
+ border-width: 1px;
+}
+
main > article > img {
display:inline-block;
border-color: var(--mid-bg);
diff --git a/tetawebapp/templates/ajax.html b/tetawebapp/templates/ajax.html
index 8bb03be..99d9fc1 100644
--- a/tetawebapp/templates/ajax.html
+++ b/tetawebapp/templates/ajax.html
@@ -1,14 +1,35 @@
{% extends "index.html" %}
{% block title %}Ajax{% endblock %}
{% block main %}
- Click the refresh button to get the HTML response. The response may randomly be a voluntary error so you should try it more than once. Click the refresh button to get the HTML response. The response may randomly be a voluntary error so you should try it more than once. Select files to upload The response may randomly be a voluntary error so you should try it more than once.Get HTML response from AJAX
- Get HTML response from AJAX
+ Upload files with AJAX
+
Select files to upload
-The response may randomly be a voluntary error so you should try it more than once.
- Upload files: -diff --git a/tetawebapp/tetawebapp.py b/tetawebapp/tetawebapp.py index 4b24874..460e4a1 100755 --- a/tetawebapp/tetawebapp.py +++ b/tetawebapp/tetawebapp.py @@ -253,8 +253,8 @@ def set_value_from_ajax(value): @app.route("/upload", methods=['POST']) @check_session def upload(): - """ Accept a value from an AJAX request - It may return an error code for testing purpose """ + """ Save a file from AJAX request + Files are saved in UPLOADED_FILES_DEST (see config.local.py) """ err_code = 'TETA_ERR' RND = int(random.random()*10) if RND % 2: @@ -267,7 +267,7 @@ def upload(): print "Uploaded files:" for f in uploaded_files: print ' [+] %s [%s]' % (f.filename, f.content_type) - # Befor saving you should: + # Before saving you should: # - Secure the filename # - Check file size # - Check content type