Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In order to accurately determine what has been uploaded, you don't check for the file extension nor for the mime type sent by <strong>browser</strong>.</p> <p>On *nix environment, you've got the utility for checking the mime type of a given file, usually located in magic.mime file (/usr/share/magic.mime or something similar, depending on your setup).</p> <p>Copy/paste from the magic.mime so you see how it works in a nutshell:</p> <pre><code># Magic data for KMimeMagic (originally for file(1) command) # # Note on adding additional MIME types: # # [RFC2045,RFC2046] specifies that Content Types, Content Subtypes, Character # Sets, Access Types, and conversion values for MIME mail will be assigned and # listed by the IANA. # http://www.iana.org/assignments/media-types/ # # Any unregistered file type should be listed with a preceding x-, as in # application/x-foo (RFC2045 5.1), or a x., as in application/x.foo (RFC4288 # 4.3). Any non x-prefixed type should be registered with IANA and listed at # the above address. Any other behavior is a MIME standards violation! # # It is preferred that when a registered MIME type exists, that # the registered Content-Type and Subtype be used to refer to a file of # that type, so don't use application/x-zip when application/zip is # registered. # # If an active RFC suggests that a MIME registration for a new type is in # progress, make a note of it pointing to that RFC. # # The format is 4-5 columns: # Column #1: byte number to begin checking from, "&gt;" indicates continuation # Column #2: type of data to match # Column #3: contents of data to match # Column #4: MIME type of result # Column #5: MIME encoding of result (optional) </code></pre> <p>I'll link you with a link that'll help you in further implementation in PHP (literally 2 lines of code once you're done).</p> <p>If you can't make it work after all of this, post here in comments and I'll provide full code needed to safely detect what has been uploaded.</p> <p><a href="http://www.php.net/manual/en/book.fileinfo.php" rel="nofollow">Fileinfo</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload