[UGLY UPLOAD BUTTON HACKS INTENSIFIES]

This commit is contained in:
Dominik V. Salonen 2015-12-23 14:41:25 +01:00
parent e689511fb5
commit 0b376d9478
3 changed files with 24 additions and 24 deletions

3
run.py
View File

@ -19,7 +19,7 @@ app = Flask(__name__)
# Pre-start functions
print_log('Main', 'Running authorization towards B2')
print_log('Main', 'Running in "' + os.getcwd() + '"')
print_log('Main', 'Checking for data folder')
if not os.path.exists(config['UPLOAD_FOLDER']):
print_log('Main', 'Data folder not found, creating')
@ -59,7 +59,6 @@ def upload_file():
thread1.start()
print_log('Thread', 'Adding to DB')
file.save(os.path.join(config['UPLOAD_FOLDER'], filename))
#db.add_file(filename)
thread1.join()
data["file"] = filename

View File

@ -10,7 +10,7 @@
body {
font-family: "Lato", sans-serif;
color: #ffffff;
background-color: #101010;
background-color: #2d2d2d;
}
.header {
@ -40,30 +40,26 @@ body {
}
.uploadForm {
margin-top: 80px;
width: 100%;
text-align: center;
}
.uploadForm input[type="file"] {
padding: 10px;
font-size: 12pt;
font-weight: 300;
border: none;
display: inline-block;
}
.uploadForm input[type="submit"] {
width: 100%;
padding: 20px;
font-size: 12pt;
font-weight: 300;
max-width: 320px;
.uploadButton {
background-color: #229922;
margin-top: 10px;
color: #FFFFFF;
border: none;
border-radius: 10px;
}
.uploadForm input[type="submit"]:hover {
background-color: #33BB33;
.uploadButton p {
padding: 20px;
}
.uploadButton input[type="file"] {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
z-index: 900;
}

View File

@ -1,7 +1,12 @@
{% extends "layout.html" %}
{% block body %}
<form action="" id="form" method="post" enctype="multipart/form-data" class="uploadForm">
<input id="file" type="file" name="file">
<form action="" id="form" name="fileForm" method="post" enctype="multipart/form-data" class="uploadForm">
<div class="uploadButton">
<input id="file" type="file" name="file">
<p>
Select a file
</p>
</div>
<input type="hidden" name="source" value="web">
</form>
<script>