Home GnuPG

Detect the MIME type of large files by examining the first chunk
01862b8f23acUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Detect the MIME type of large files by examining the first chunk

Summary:
Fixes T11242. See that task for detailed discussion.

Previously, it didn't particularly matter that we don't MIME detect chunked files since they were all just big blobs of junk (PSDs, zips/tarballs, whatever) that we handled uniformly.

However, videos are large and the MIME type also matters.

  • Detect the overall mime type by detecitng the MIME type of the first chunk. This appears to work properly, at least for video.
  • Skip mime type detection on other chunks, which we were performing and ignoring. This makes uploading chunked files a little faster since we don't need to write stuff to disk.

Test Plan:
Uploaded a 50MB video locally, saw it as chunks with a "video/mp4" mime type, played it in the browser in Phabricator as an embedded HTML 5 video.

{F1706837}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11242

Differential Revision: https://secure.phabricator.com/D16204

Details

Event Timeline

epriestley <git@epriestley.com> committed rPHAB01862b8f23ac: Detect the MIME type of large files by examining the first chunk (authored by epriestley <git@epriestley.com>).Jun 30 2016, 10:57 PM