• 
      

    Guess the mimetype of uploaded files when they're unknown.

    Review Request #3667 — Created Dec. 14, 2012 and submitted — Latest diff uploaded

    Information

    Review Board
    release-1.7.x

    Reviewers

    Guess the mimetype of uploaded files when they're unknown.
    
    Browsers can send an empty mimetype when they don't know what kind of
    file we're working with. This triggers a code path that fails, and even
    with that fixed, makes a number of files useless. For example, text
    files without .txt, or images masquerading as .bin files, or shell
    scripts.
    
    Now, if we're not told of a good file type, and `file` exists, we'll use
    that to determine the type of file. This captures a number of file types
    we otherwise wouldn't be told about.
    Uploaded some files I had sitting around. AUTHORS, some .sh files, renamed PNGs.
    The thumbnails ended up correct.