Page MenuHomePhorge

D25352.1732310964.diff
No OneTemporary

D25352.1732310964.diff

diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -287,7 +287,7 @@
// NOTE: Once we receive the first chunk, we'll detect its MIME type and
// 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');
+ $mime_type = idx($params, 'mime-type', '');
if (!strlen($mime_type)) {
$file->setMimeType('application/octet-stream');
}
diff --git a/src/applications/files/storage/__tests__/PhabricatorFileTestCase.php b/src/applications/files/storage/__tests__/PhabricatorFileTestCase.php
--- a/src/applications/files/storage/__tests__/PhabricatorFileTestCase.php
+++ b/src/applications/files/storage/__tests__/PhabricatorFileTestCase.php
@@ -532,4 +532,11 @@
$this->assertEqual(array(), $alternate_c);
}
+ public function testNewChunkedFile() {
+ $engine = new PhabricatorTestStorageEngine();
+ $file = PhabricatorFile::newChunkedFile($engine, 10, []);
+ $this->assertTrue($file instanceof PhabricatorFile,
+ pht('newChunkedFile returns a PhabricatorFile'));
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 21:29 (5 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
989325
Default Alt Text
D25352.1732310964.diff (1 KB)

Event Timeline