horizon
horizon copied to clipboard
Support for file uploads
There should be a way for applications built with Fusion to support file uploads from users. This would probably involve providing a standard REST endpoint that handles mulitpart form requests. It would be especially cool if there was a way to configure the Horizon server so that it automatically stores the uploaded file content in an S3 or B2 bucket.
In ClojureScript, we use https://github.com/martinklepsch/s3-beam for this purpose, and it lets us upload directly to S3 without going through our application.
Why not stream the files via WebSockets as well? It's more performant, works pretty good across browsers and there are none of the annoying problems with legacy APIs with file uploads from browsers. There's a library that I've been using with great results that accomplishes just that: https://github.com/binaryjs/binaryjs
Agree with @danielcompton's solution. If you are storing files to CDN it might be useful to have a mechanism to send the file directly to CDN from the client using access control headers like the slingshot project on meteor. We must protect the server from having to deal with the load of accepting image uploads and transfering them to a CDN this way. https://github.com/CulturalMe/meteor-slingshot
We should consider using ReGrid for this and allow storing the files directly in RethinkDB. https://github.com/internalfx/regrid
Either that or it might be simpler to just allow giving Horizon a B2, GCS, or S3 token and bucket name and we can upload there?
2016-09-08 16:53 GMT-07:00 Daniel Mewes [email protected]:
We should consider using ReGrid for this and allow storing the files directly in RethinkDB. https://github.com/internalfx/regrid
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rethinkdb/horizon/issues/186#issuecomment-245778223, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0sNrylGLF4Kz6WP7tBstcwYFhHaviNks5qoKAPgaJpZM4HrTW0 .
I think both are useful for different scenarios.
I think regrid should be closest to rethinkdb. I guess the team should consider it more especially for one deploying a self contained solution. It will be nice if rethinkdb should consider it the way gridfs is to mongo.