2

I am using the official Filepicker gem for Rails applications and so far, if I want to specify the mimetypes as all images, I am doing it this way:

extensions: ".png,.jpg,.jpeg,.gif"

On the official documentation page on the Filepicker website, there is shown this approach:

image/*

So I've tried to use this approach for the Filepicker gem in the used notation:

extensions: "image/*"

But when I try to upload something, it gives error regarding to an incorrect file type... How to properly allow all kind of images?

Thank you

user984621
  • 46,344
  • 73
  • 224
  • 412

1 Answers1

0

You are confusing extensions and mimetypes. From the readme:

  • extensions - The extensions of file types you want to support for this upload. Ex: ".png,.jpg".
  • mimetypes - The file types you want to support for this upload. Ex: "image/png,text/*".

Offtopic: Why is this the official Filepicker gem?

zwippie
  • 15,050
  • 3
  • 39
  • 54
  • Oh, I didn't notice it. Inattention. "Offtopic: Why is this the official Filepicker gem?" -> Beucase it's from the creators of Filepicker. – user984621 Mar 11 '14 at 11:07
  • Ah ok, I missed that Filepicker is a real service and not just some file upload *assistant*. For the real problem: Did you try `mimetypes: "image/*"`? – zwippie Mar 11 '14 at 13:31