-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
43 lines (33 loc) · 1.22 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from flask import Flask, render_template, request
from werkzeug.utils import secure_filename
import os, flask
# noinspection PyUnresolvedReferences
import excel2flapjack as e2f
#import excel2sbol
cwd = os.getcwd()
upload_folder = os.path.join(cwd,'public')
app = Flask(__name__)
# app.config['UPLOAD_FOLDER'] = upload_folder
@app.route('/status')
def status():
return("The Public Server for the EDC is up and running")
@app.route('/upload')
def upload_file_template():
return render_template('upload.html')
@app.route('/uploader', methods = ['POST'])
def upload_file():
if request.method == 'POST':
f = request.files['file']
fj_user = request.form['fjusername']
fj_pass = request.form['fjpwd']
# hashmap = excel2flapjack.upload(f, fj_user, fj_pass)
# file = excel2sbol(f)
#linked_file = addflapjacklinks(file)
#submit linked_file to synbiohub
#f.save(os.path.join(upload_folder, secure_filename(f.filename)))
#print(f)
#print(request.form)
#print(request.form['sbhusername'])
return render_template('upload_success.html', file_uploaded=secure_filename(f.filename))
#fj_user = "username2"
#fj_pass = "pwd2"