Spaces:
Sleeping
Sleeping
Commit ·
cb5042d
1
Parent(s): 5b80bdd
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -17,6 +17,22 @@ def put():
|
|
| 17 |
f.save(file)
|
| 18 |
return "ok"
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
@app.route("/c")
|
| 21 |
def c():
|
| 22 |
import shutil
|
|
|
|
| 17 |
f.save(file)
|
| 18 |
return "ok"
|
| 19 |
|
| 20 |
+
|
| 21 |
+
@app.route("/ls", methods = ['GET'])
|
| 22 |
+
def ls():
|
| 23 |
+
fs = os.listdir(data_folder)
|
| 24 |
+
return "|".join(fs)
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
@app.route("/rm", methods = ['POST'])
|
| 28 |
+
def rm():
|
| 29 |
+
d = request.headers
|
| 30 |
+
file_name = d['File']
|
| 31 |
+
os.remove(os.path.join(data_folder, file_name))
|
| 32 |
+
return 'ok'
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
|
| 36 |
@app.route("/c")
|
| 37 |
def c():
|
| 38 |
import shutil
|