Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translate_document() should seek(0, 0) the output file after being done #96

Open
Nama opened this issue Feb 21, 2024 · 0 comments
Open

Comments

@Nama
Copy link

Nama commented Feb 21, 2024

After the output_document is finished, the pointer should be set to 0, 0 to make further processing possible.

result = BytesIO()
translator.translate_document(input_document=source_file, output_document=result, target_lang=target_lang, filename=source_file.filename)
result.seek(0, 0)  # required, else flask wont send the file
return flask.send_file(result, download_name=source_file.filename, as_attachment=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant