Merge branch 'master' of https://git.vvvvvvaria.org/ccl/hp-library
This commit is contained in:
commit
3811f67885
33
library.py
33
library.py
@ -99,7 +99,7 @@ def test():
|
|||||||
print("test")
|
print("test")
|
||||||
clicked=None
|
clicked=None
|
||||||
bundle = "bundle.zip"
|
bundle = "bundle.zip"
|
||||||
zipObj = ZipFile(bundle, 'w')
|
# zipObj = ZipFile(bundle, 'w')
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
# clicked=request.form['data']
|
# clicked=request.form['data']
|
||||||
@ -109,22 +109,19 @@ def test():
|
|||||||
print("hola")
|
print("hola")
|
||||||
|
|
||||||
|
|
||||||
|
with ZipFile(bundle, 'w') as zipObj2:
|
||||||
# create a ZipFile object
|
|
||||||
|
|
||||||
# Add multiple files to the zip
|
# Add multiple files to the zip
|
||||||
zipObj.write('static/files/'+listofselecteddocs[0])
|
|
||||||
zipObj.write('static/files/'+listofselecteddocs[1])
|
|
||||||
zipObj.write('static/default-files/hello.txt')
|
|
||||||
# close the Zip File
|
|
||||||
|
|
||||||
# return render_template('test.html')
|
readmeabsname = 'static/default-files/hello.txt'
|
||||||
# return send_file(bundle, mimetype='application/zip', as_attachment=True, attachment_filename=bundle)
|
readmearcname = "hello.txt"
|
||||||
# TEST
|
zipObj2.write(readmeabsname,readmearcname)
|
||||||
# print("sending file...")
|
|
||||||
# result = send_file(bundle, as_attachment=True)
|
for doc in listofselecteddocs:
|
||||||
# print("file sent, deleting...")
|
absname = 'static/files/'+doc
|
||||||
# os.remove(bundle)
|
print(doc)
|
||||||
# return result
|
arcname = os.path.basename(doc)
|
||||||
zipObj.close()
|
zipObj2.write(absname, arcname)
|
||||||
return send_file(bundle, mimetype='application/zip', attachment_filename="hello.zip", as_attachment=True)
|
|
||||||
|
|
||||||
|
|
||||||
|
return send_file(bundle, mimetype='application/zip', attachment_filename="bundle.zip", as_attachment=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user