Closed parwatcodes closed 5 years ago
not sure should i name it shrine.rb or uppy-s3_multipart.rb
You can name Rails initializers whatever you want 😉. In this case shrine.rb
makes sense to me, because you're configuring Shrine.
Running rails routes command doesn't list the routes:
That's expected. Rails will only lists routes for Rails engines, because those define their routes via the Rails router. Uppy::S3Multipart::App
is just an object that responds to #call
and returns a response based on request information (= a rack app). Rails doesn't know how it does the routing internally, because it doesn't use Rails routing for that.
If Rails provided a mechanism for Rack apps to declare their routes, then I'd be open to adding support for that in uppy-s3_multipart.
What I am trying to achieve is
aws-s3-multipart
uppy plugin to support large files with resumable, which gets upload to s3 bucket.Please correct me if anything is wrong
How can i achieve that
You now just need to point Uppy's serverUrl
to your Rails app, as per the README. Are you encountering any problems with that?
I think you misunderstood my last comment. Uppy::S3Multipart::App
still adds the /s3/multipart/*
routes and they should work. Rails is only not displaying them in rake routes
, but that doesn't mean they're not there.
Oh. Can you tell me how to implement whole flow work on ruby server. (resumable upload to s3
Let's assume I made the routes and initializers setup. Now, what further steps should I need to follow
I'm pretty new to rails. Any help is highly appreciated.
With the routes and initializers setup (and S3 bucket setup of course), clients should now be able to successfully upload the video.
Once the upload finishes, you can attach it with Shrine like with any other kind of direct upload. See this wiki page for a complete example. It's using Roda and regular S3 upload, but it should be easy to translate to Rails. There is also a Rails demo app linked in the Shrine README.
Note that uppy-s3_multipart
is only in charge of the client side upload to S3, everything else is regular Shrine, so you should look at the Shrine documentation for how to attach directly uploaded files.
I am trying to use this plugin in my rails app.
As per the docs.
config/initializers/shrine.rb
not sure should i name it
shrine.rb
oruppy-s3_multipart.rb
config/routes.rb
Running
rails routes
command doesn't list the routes. It shows