Rails 5: How to send and process large files (200Mb) via Rails API?

74 views
Skip to first unread message

Tomasz Antas

unread,
Jul 31, 2016, 11:50:23 AM7/31/16
to Ruby on Rails: Talk

I'm looking for the general concept, but every tip can be useful. The client (mobile) has to send a large file to Rails API. It's a some text file with raw data.

How can the Rails API get the large file from client? Should it be done by HTTP request, websockets? Should the files be sent in chunks?

Frederick Cheung

unread,
Jul 31, 2016, 12:35:24 PM7/31/16
to Ruby on Rails: Talk
On Sunday, July 31, 2016 at 4:50:23 PM UTC+1, Tomasz Antas wrote:
> I'm looking for the general concept, but every tip can be useful. The client (mobile) has to send a large file to Rails API. It's a some text file with raw data.
> How can the Rails API get the large file from client? Should it be done by HTTP request, websockets? Should the files be sent in chunks?

This obviously depends on your setup but I would probably have the client send the file straight to s3 and process it asynchronously

Fred

Greg Navis

unread,
Aug 3, 2016, 6:54:12 AM8/3/16
to rubyonra...@googlegroups.com
What Frederick said. Sending it through the app would block the worker handling the upload. The API might become unavailable for other clients.
Reply all
Reply to author
Forward
0 new messages