Use flask send_file to return DMN file
This commit is contained in:
parent
93e8015ddd
commit
a3b3df1bbb
|
@ -1,4 +1,5 @@
|
|||
import io
|
||||
from datetime import datetime
|
||||
from typing import List
|
||||
|
||||
import connexion
|
||||
|
@ -176,4 +177,10 @@ def delete_file(file_id):
|
|||
def dmn_from_ss():
|
||||
file = connexion.request.files['file']
|
||||
result = FileService.dmn_from_spreadsheet(file)
|
||||
return result
|
||||
return send_file(
|
||||
io.BytesIO(result),
|
||||
attachment_filename='temp_dmn.dmn',
|
||||
mimetype='text/xml',
|
||||
cache_timeout=-1, # Don't cache these files on the browser.
|
||||
last_modified=datetime.now()
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue