Ok, after a little research and hacking, I've come up with a
relatively neat solution to this problem.... It involves using the
mime-types gem (sudo gem install mime-types), for some reason, I
couldn't get mimetype_fu working here.
ok, so my model is 'track', and the attachment is 'mp3'... don't
forget "require 'mime/types' " at the top of the model
here's the model code:
http://www.pastie.org/585809
and here's the controller method:
http://www.pastie.org/585815
Hopefully this will help someone else
On Jul 28, 4:01 pm, Paul Nelligan <
nell...@gmail.com> wrote:
> Hi Simon
>
> I've had similar issues, and have yet to resolve these. I posted another
> thread on this group. If you do a search for 'application/force-download'
> in the group you will find it.
>
> I would be interested in keeping in touch regarding these issues and sharing
> information.
>
> cheers
>
> Paul
>
> On Tue, Jul 28, 2009 at 3:42 PM, Simon <
simonr...@gmail.com> wrote:
>
> > Hi all,
>
> > We're using Paperclip to manage straight uploading of mp3 files to S3
> > (no pre or processing), we're restricting content types to the
> > following:
>
> > ["audio/mpeg","audio/x-mpeg","audio/mp3","audio/x-mp3","audio/
> > mpeg3","audio/x-mpeg3","audio/mpg","audio/x-mpg","audio/x-
> > mpegaudio","application/mp3"]
>
> > Everything works nicely with most browsers, however we're having
> > terrible trouble with Firefox on Windows not sending uploads with the
> > correct mimetype..
>
> > We've attempted to override Paperclip::Attachment assign method to use
> > mimetype_fu to double check the mimetype if it doesn't match our list,
> > but this seems to be a little flaky so far.. (this hack is based on
> > this paperclip fork -
http://github.com/dejanstrbac/paperclip/tree/master)