Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/storage/PhabricatorFile.php
| Show First 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | public static function newChunkedFile( | ||||
| $length, | $length, | ||||
| array $params) { | array $params) { | ||||
| $file = self::initializeNewFile(); | $file = self::initializeNewFile(); | ||||
| $file->setByteSize($length); | $file->setByteSize($length); | ||||
| // NOTE: Once we receive the first chunk, we'll detect its MIME type and | // NOTE: Once we receive the first chunk, we'll detect its MIME type and | ||||
| // update the parent file. This matters for large media files like video. | // update the parent file if a MIME type hasn't been provided. This matters | ||||
| // for large media files like video. | |||||
| $mime_type = idx($params, 'mime-type'); | |||||
| if (!strlen($mime_type)) { | |||||
| $file->setMimeType('application/octet-stream'); | $file->setMimeType('application/octet-stream'); | ||||
| } | |||||
| $chunked_hash = idx($params, 'chunkedHash'); | $chunked_hash = idx($params, 'chunkedHash'); | ||||
| // Get rid of this parameter now; we aren't passing it any further down | // Get rid of this parameter now; we aren't passing it any further down | ||||
| // the stack. | // the stack. | ||||
| unset($params['chunkedHash']); | unset($params['chunkedHash']); | ||||
| if ($chunked_hash) { | if ($chunked_hash) { | ||||
| ▲ Show 20 Lines • Show All 1,366 Lines • Show Last 20 Lines | |||||