rubyonjets/jets

Files streaming

Closed this issue · 4 comments

Hello.
Is there a way to stream files using jets framework?
I was trying using https://github.com/WeTransfer/zip_tricks or ActionController::Live but it seems jets response does not support this.

Short answer: don’t think so. Locally you may be able to get it to work. But on AWS Lambda and API Gateway, it would work differently and wouldn’t work. So it’s a bit of work.

@tongueroo sorry, but could you, please, explain a bit why that wouldn't work on AWS Lambda and API Gateway.
Docs say it's possible to work with binary files https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-content-encodings-examples-image-lambda.html

Oh I could be mistaken here. Was thinking about websocket streaming. For binary files like images, believe it works. But it’s been a while since tested. https://blog.boltops.com/2018/12/13/jets-image-upload-carrierwave-tutorial-binary-support/ Vaguely remember that had return a specific type of response for it to work. Jets should do this but your miles may vary. Binary data through APIGW seems to be a pain. So it may not work. You’d probably have a better experience using s3. At least wanted to provide an answer.

@tongueroo thanks for your response (and the suggestion about the s3 approach, will check it out)