horizon icon indicating copy to clipboard operation
horizon copied to clipboard

Support for file uploads

Open segphault opened this issue 8 years ago • 7 comments

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.

segphault avatar Mar 07 '16 23:03 segphault

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.

danielcompton avatar Mar 08 '16 00:03 danielcompton

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

niieani avatar Mar 12 '16 11:03 niieani

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

shantanubhadoria avatar Jul 27 '16 03:07 shantanubhadoria

We should consider using ReGrid for this and allow storing the files directly in RethinkDB. https://github.com/internalfx/regrid

danielmewes avatar Sep 08 '16 23:09 danielmewes

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 .

dalanmiller avatar Sep 08 '16 23:09 dalanmiller

I think both are useful for different scenarios.

danielmewes avatar Sep 08 '16 23:09 danielmewes

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.

lavvy avatar Sep 09 '16 00:09 lavvy