I have this simple fuction
def return_srt_file(data, filename) -> Response: buffer = BytesIO() buffer.write(data.encode("utf-8")) buffer.seek(0) resp = make_response(buffer.read()) resp.headers["Content-Disposition"] = f"attachment; filename={filename}.srt" resp.headers["Content-Type"] = "application/x-subrip" resp.headers["Content-Length"] = str(len(data.encode("utf-8"))) return respthat on my local pc, returns a subtitle file. Whole subtitle is set to a string in the data variable. It has only 39kbs. But when I try to download it on my deployed app, I'm getting an empty file - 0b. In logs I can see content of the file.
I think I tried all possible methods of sending a file, including saving it in the /tmp directory. Nothing works, it is always returned as a 0b file
Can anyone help me?
