Multiple file uploads?

Hi all,

This is my first post, so I’ll start by just saying hello, as I imagine
I will be spending a lot of time on this forum in the future.

Any way, to my problem… I am trying to build the functionality to
upload multiple images with an ‘article’ object for a blog post in a
Rails app. I assumed this would be a fairly simple thing to implement,
but 4 weeks later, and after trying every tutorial using either
paperclip, carrierwave or html5 up to three pages deep on Google, I am
no closer to achieving my goal than when I started, but I am a hell of a
lot more confused and lost than when I started.

To achieve this functionality, ideally I would like to use Paperclip, as
I am familiar with it’s standard single file upload, and often use it
with S3. The upload doesn’t have to be pretty, I just really want it to
work in a way that will allow me to upload several images along with a
title and body text.

If any of you know how to achieve this, or know any clear tutorials
without missing parts or explanations, or videos you can link me to, I
would be very appreciative.

Thank you kindly in advance for any help anyone is willing to pass my
way.

I hope someone here can help me. Frazer.

Hi Frazer,

AFAIK you cannot upload multiple files - the trick is to upload one at a
time, at least if you do it async with javascript.

otherwise I’d like to think this one does it:
https://u.osu.edu/hasnan.1/2014/03/30/rails-4-multiple-file-upload-with-carrierwave-nested-form-and-jquery-file-upload/

cheers
Walther

There is also refile…

I wrote about this earlier this year. You can see all the details here:
https://groups.google.com/d/msg/rubyonrails-talk/i0nNJMbHtrk/mBjOvBjTEgAJ

It’s not difficult once you grasp the trick of it. Rails provides all
the pieces you need, you just have to phrase the question so that it
understands you properly!

Walter

Hi again, and thanks for the replies.

However, I am still finding this an impossible task. I have worked
through the Refile documentation multiple times, and although the code
seems to work, I can’t get it to actually display any of the pictures I
upload, either from cache, file or through S3.

I have worked through the other suggestions too, but I cannot make this
functionality work. There must be something fundamental I am missing
that isn’t shown in the tutorials. This is another week I have spent
unable to find any working solution to this problem and I refuse to
believe that this is functionality is actually this hard to implement.

I really need help on this as this is the fifth week I have spent on it
and have literally tried every tutorial and none of them have worked.

Is there any further help I can ask for on this issue?

Chris Oliver has a nice vid on this:
File Uploads with Refile (Example) | GoRails Can you post any
errors you are getting? I’ve also found Chris to be very responsive on
his vids so you could also try posting a query to him on this vid
comments section…