-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
has contents that are not what they are reported to be #2139
Comments
Hi @BilalReffas. We need more information to know how to help you on this issue. See https://github.com/norman/yourbugreportneedsmore.info/blob/master/index.html/. Also, consider asking in StackOverflow, where a bigger community might be able to better help you. Thanks! |
I using the google cloud storage on the development mode everything works fine. But when I want to upload an image in the production. I get this validation error. :( |
Paperclip 3.5, Rails 4.2.5 |
@vietntframgia Do you use google cloud in production ? I solve it see the link on stackoverflow. |
@BilalReffas I suggest working with the other response, http://stackoverflow.com/a/36241460, as the spoof detection is a security mechanism. Is this a bug in paperclip, you think? |
But only my solution works.. The other solution don't work for me..:( |
can you guys post the BROWSER and OPERATING SYSTEM that you are using to make the upload? It turns out the content-type header is highly dependent on the operating system |
Here are two different log entries for Chrome submission of a CSV file. One is on Windows, and another on a Mac: WINDOWS Chrome
MAC OS X Chrome
As you can see, on Mac, the content_type is set correctly to |
The issue for WIndows is describe here: http://stackoverflow.com/questions/1201945/how-is-mime-type-of-an-uploaded-file-determined-by-browser I would love to find a solution to this... I tried to edit my Windows registry (yes, that is what they tell you must do) and even that didn't work. So basically, if you're trying to validate a content-type from a Windows machine that is not in the default list of Windows MIME types, you are essentially SOOL. As of now, I have yet to be able to find a work-around to this. |
basically, because of this issue, I feel that |
my issue is slightly unrelated so I will open a new issue |
I kind of have a similar issue. Currently using paperclip 4.3.6. This is currently happening on MacOSx, and I haven't got yet a log from the server side. From my understanding, paperclip is running |
@rpbaltazar can you examine and report on the |
Not sure if this is what you're looking for, but this is what i'm getting: |
@jasonfb @rpbaltazar Getting a similar error. [paperclip] Content Type Spoof: Filename power_of_number_question.c (application/octet-stream from Headers, ["text/x-c", "text/plain"] from Extension), content type discovered from file command: text/x-c. See documentation to allow this combination. |
we worked around our problem with validates_attachment_content_type :attachment,
:content_type => %w(text/csv application/vnd.ms-excel),
:message => "invalid content type. If you are on a Windows computer, you must have MS Excell installed to use this uploader" which is whack but you know so is Windows, so bob's your uncle. |
I can't reproduce this too, but on windows, it does. |
To reproduce use a client / browser system Windows Vista or XP with Firefox or Chrome. The same error can be reproduced on Windows 8 & 10 as well with Chrome (based on a user report). |
Closing as duplicate of #1924, as there is no new context here that is not in there. |
Hello I have a problem using paperclip on the google app engine. So it works localy but remote on google cloud. I get an validation error.:(
validates_attachment_content_type :image, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif"]
The text was updated successfully, but these errors were encountered: