How can I upload a GarageBand (.band) file into my rails app? - ruby-on-rails

I am creating a Rails app which should allow users to upload any type of audio file format. I am currently using Carrierwave gem to accomplish this, however CarrierWave will not allow uploads of certain file formats such as .band (GarageBand default format).
Is there a way to accomplish this?

Well, .band is actually a folder containing multiple files. So, yes, carrierwave does not allow uploads of folders. The folder must be converted into a .zip file.

Related

Can I use zipline gem to download from s3 without model associations with paperclip or carrierwave

I want to allow my user to download a bundle of files that are stored on s3 using the zipline gem. The files are already hosted on an s3 server but they aren't there as part of a paperclip or carrierwave attachment in my app. Will I need to create some records in my database to sort of trick zipline into thinking they are paperclip attachments, or is there a way I can send the zip file without bothering with an attachment gem? At the moment, trying to download the files with zipline doesn't throw an error message at all. It just seems to skip right over and nothing downloads.
See the part of the zipline README where an enumerator gets used to include remote files into the ZIP. It uses absolute URLs, to generate those from your S3 objects you will need to use presigned URLs (which Zipline is going to pass on to Curb):
Aws::S3::Bucket.new(your_bucket_name).object(your_key).presigned_url(:get)

aws - how to store the file details using s3_direct_upload

In rails 4.0.2, I am using s3_direct_upload gem to upload files directly to s3, after that I want to store the files & convert it to html, also I want to store some dependency files like converted .html / .txt files back to s3. But I am not able to get the files from s3 & also it is not saving to the database.
I have referred this from http://blog.littleblimp.com/post/53942611764/direct-uploads-to-s3-with-rails-paperclip-and.
How can I overcome this problem? awaiting for the solution.

Upload files on multiple server (S3, Dropbox, ...)

I'm designing a little application using Rails and I need to upload files. I searched and I found paperclip + Carrierwave to do that. I've also seen that it's possible for that gems to specify where to store the uploaded file in the model.
My question is : Using Paperclip, is it possible to know at runtime where the user wants to upload the file and of course is it possible to catch and save the file to the corresponding host ?
Regards

How should I parse a file in Ruby on Rails to store in a database?

I want to create a simple form for users to upload a file, which will be stored in a database. I also want to display all the submitted files in the database with their name and a link to download the file. Schematically, what's the best way to do this in Rails/how should I store the file in table (which fields should my table have? etc). Thanks!
i would use paperclip gem with the upload to s3 instead of file system
https://github.com/thoughtbot/paperclip
checkout the README, most of the examples are for an image, but works with non-image files as well
use paperclip to upload file, you can store images/file in your database as well as in s3 (AWS)
See below link how to use paperclip in rails with example
Here is the steps how to upload file using paperclip in rails
http://patshaughnessy.net/2009/4/30/paperclip-sample-app
for github
https://github.com/thoughtbot/paperclip
https://github.com/websymphony/Rails3-Paperclip-Uploadify

Could paperclip handle non-image files?

I am using Ruby on Rails 2.3.5
I want to let the user upload files, not only images, but also music files or just txt documents.
Could I use paperclip for this purpose (I will store those files in Amazon S3)? Is there any special things I have to note about?
Or if the paperclip gem could not handle them, what could I use?
Paperclip does all you asked. I also used to upload mp3 files with paperclip to rackspace cloud. Never had any sort of problems.

Resources