mirror of
https://github.com/VLSIDA/OpenRAM.git
synced 2026-08-30 09:58:33 +02:00
Flask directory upload POC, embed datasheet.info in html comment for parser reuse
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import os
|
||||
from flask import Flask, render_template, request
|
||||
from werkzeug import secure_filename
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/uploader', methods = ['GET', 'POST'])
|
||||
def upload():
|
||||
if request.method == 'POST':
|
||||
f = request.files['file']
|
||||
dirname = os.path.dirname(os.path.abspath(__file__))
|
||||
f.save(dirname + '/uploads/' + secure_filename(f.filename))
|
||||
return 'file uploaded successfully'
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug = True)
|
||||
@@ -0,0 +1,11 @@
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<form action = "http://localhost:5000/uploader" method = "POST"
|
||||
enctype = "multipart/form-data">
|
||||
<input type = "file" name = "file" />
|
||||
<input type = "submit"/>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user