Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

MIME type error

Started by Muut Archive 10 years ago · 2 replies · 474 views
10 years ago

Hi all, I am having a bit of a problem. I use a form to let the user upload PDF files. However sometimes I get error messages from clients that the MIME type is not support allthough its a valid PDF. What causes the error? I made the following setting my form.md file:

YAML
- name: filename
        label: Some label here
        type: file
        multiple: false
        destination: tmp_uploads
        validate:
          required: true
          message: Some error message
        accept:
          - application/pdf
          - application/msword
          - application/vnd.openxmlformats-officedocument.wordprocessingml.documen t

I also accepted word documents to be be uploaded and that works well. It also seems that it's not a general problem as most of the users have no problems uploading a PDF. This error only occurs from time to time.

10 years ago

Just guessing, maybe the MIME type of the file they are uploading is application/x-pdf?

10 years ago

Yeah I did a little research and stumbled over the x-pdf type as well. Will try it with this and test it again. Thanks :)

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1357 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2955 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago