Hi everyone,
I’m currently trying to implement file streaming from within Frappe, specifically chunked streaming for large files (audio recordings).
I would like to ask:
-
Does Frappe provide any built-in function or recommended way to stream files in chunks?
-
Is there an official pattern for returning streaming responses (e.g., using
Response, generators, or Werkzeug utilities)?
My current requirement is to stream audio files instead of returning them as a full file response, because some recordings are quite large.
I have tried multiple approaches (custom whitelisted methods returning Response objects (from werkzeug.wrappers and manually reading files in chunks)
However, it does not work reliably.
When iOS mobile clients request the audio file, most of the time the recording becomes distorted (noisy / corrupted sound).
I’m not sure whether this is caused by:
-
Missing
Content-Length -
Missing
Accept-Ranges/Rangeheader handling -
Incorrect response type in Frappe
-
Or incompatibility with how Frappe handles streaming internally
Has anyone successfully implemented proper chunked streaming in Frappe. Any guidance or best practice would be greatly appreciated.
Thank you!