Heroku Database Upload to Amazon s3 - ruby-on-rails

I want to upload a Database Dump to an Amazon s3 Bucket, but im quite not sure, how to do it.
I was searching for Tutorials and already got a Bucket and an IAM User. Just to be honest, i dont know how to create the script for uploading it. I'm working with Rails 5.
I'm not a Pro Developer, so maybe someone here can explain in many steps how to do it.
Thank you and have a good day!

Search for carrierwave gem. It is a file upload mechanism that supports Amazon S3. It might be a little complicated for you because it has a lot of configs to set.
reference: https://www.rubydoc.info/gems/carrierwave/0.5.1/CarrierWave/Storage/S3

Related

Edit and modify Word and Excel files from within the browser

I have a Ruby on Rails application where users can upload files. We run this application in production on home-rolled linux servers. (No Heroku or anything like that.) Using the carrierwave gem, they get stored on AWS S3. Very simple and straight-forward.
If someone wanted to view or modify those files that are stored on S3 without having to download them, open them in Word or Excel, and then reupload- how could that be done?
The only people who have seemed to implement something like this are Dropbox and Citrix ShareFile. They did it using Office Online.
I don't mind moving file storage off S3 to somewhere else (or even something home-rolled) to implement this feature- but it needs to be as reliable and robust as S3.
We've tried to something with WebDAV, but it is fragile and seems to be deprecated.
We would consider any solution, paid or free.
You can indeed use the WOPI framework for this. There are quite a lot of resources and code samples for this, of which the most useful might be This Github Repo. The framework allows you to programmatically integrate into the Word Online viewer/editor.
Hope this helps,
Jesse

Gems/plugins for uploading multiple files in rails?

Specifically, I would like to allow a user to upload up to 5 images. Any direction to a simple tutorial would be greatly appreciated. Ideally the data for the uploaded file would be stored in an existing database. I have tried paperclip, but I can't seem to get it to work with multiple files. I've also tried some other tutorials from 2008 that don't seem to work w/ rails 3.Thanks for the help!
I would prefer direction of tutorials that you have tried and worked.
Since I had the same problem yesterday, I wrote a tutorial about it: http://blog.powpark.com/2013/10/16/multiple-file-upload-with-html5-and-rails-admin/
I think one of the most popular file-upload gems is Carrierwave (https://github.com/carrierwaveuploader/carrierwave). There is also a demo app (https://github.com/kdironside/carrierwave-multi-file-upload) that specifically demonstrates uploading multiple files.
However, it's certainly possible to accomplish the same thing with Paperclip. Perhaps you can let us know what problem you ran into specifically, and we can help you out there.

How do I set up a rails app where many users are uploading images at the same time?

I like to use heroku and paperclip for image uploads. Usually my users don't need to upload many images.
I'm now embarking on a website where many users will be trying to upload images at the same time. Unfortunately on heroku, it seems I need a separate dyno for every image upload, otherwise the site becomes unresponsive. Or am I missing something?
What is an optimal way to set up a rails application (not necessarily on Heroku) where the site can easily deal with (in a scalable way, ideally) multiple uploads at the same time?
This is a shortcoming with Heroku - it doesn't handle file uploads very efficiently. See this article that discusses this point, among others. The author suggests using the carrierwave_direct gem or the Cloudinary service. Neither concept will work well for Paperclip as it doesn't provide cloud storage support. You might want to move to CarrierWave for easier implementation of these concepts.

What is the simplest Rails file upload method?

I've looked at the available options and it seems like everything is optimized for image uploading as display. I just need simple file upload and retrieval. Are there any good options?
Paperclip is a popular choice for uploading and sizing images, but you can upload any type of file with it (doc, zip, txt, pdf... anything). Highly recommended. https://github.com/thoughtbot/paperclip
I like carrierwave. It has built in support for s3, has no workaround for setting up apps on heeroku unlike paperclip.
I use Carrierwave for mine and have been happy with it. I am just uploading general files, not specifically images. It is easy to implement and has good advanced features if you need them later. It also integrates with Fog to make using remote storage sources (like s3 or rackspace cloud files) easy.
Carrierwave benefits:
With carrierwave, the attachment is a seperate model instead of an attribute on an existing model, which might make things cleaner to work with.
It comes with the ability to attach a file via url (user passes in a url to a file) instead of uploading with a form).
It comes with some sort of way to remember files across form validation failures, although I've never used this and I'm not sure how it's done... maybe with two forms and ajax?
It seems to have a more engaged and enthusiastic community around it, with more projects extending it.
For S3, they use fog instead of aws-s3, and fog has much more active development.
That said, paperclip is pretty great and is actively maintained, and might come with handier default image manipulation stuff, I'm not sure.

Storing images with Heroku

I've created a RoR application, and I've got everything set up except for storing photos. I was wondering how I would accomplish this?
I've heard that Amazon S3 is the way to go and there is a nice gem called paperclip that works great with S3, however paperclip is meant for SQL based DB systems and I'm using MongoDB. Any help would be greatly appreciated!
I'm tackling the exact same problem. S3 easy and straight forward. In the throws of coding now so can't attest to reliability from Rails side but my research led me to Carrierwave https://github.com/jnicklas/carrierwave over Paperclip. There's a Railscast (Episode #253) to help get you started.

Resources