Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions 6 document-service/src/unstract/document_service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
from typing import Any

import redis
from flask import Flask, request, send_file
from flask import Flask, request
from odf import teletype, text
from odf.opendocument import load
import flask
from pathlib import Path

logging.basicConfig(
level=logging.INFO,
Expand Down Expand Up @@ -205,7 +207,7 @@ def find_and_replace():
except Exception as e:
app.logger.error(f"Error while converting file to {output_format} format: {e}")
return f"Error while converting file to {output_format} format!", 500
return send_file(file_name_output, as_attachment=True)
return flask.send_from_directory((p := Path(file_name_output)).parent, p.name, as_attachment=True)


if __name__ == "__main__":
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.