Page MenuHomePhabricator

D17651.id42451.diff
No OneTemporary

D17651.id42451.diff

diff --git a/src/applications/files/conduit/FileUploadChunkConduitAPIMethod.php b/src/applications/files/conduit/FileUploadChunkConduitAPIMethod.php
--- a/src/applications/files/conduit/FileUploadChunkConduitAPIMethod.php
+++ b/src/applications/files/conduit/FileUploadChunkConduitAPIMethod.php
@@ -61,15 +61,20 @@
$mime_type = 'application/octet-stream';
}
+ $params = array(
+ 'name' => $file->getMonogram().'.chunk-'.$chunk->getID(),
+ 'viewPolicy' => PhabricatorPolicies::POLICY_NOONE,
+ );
+
+ if ($mime_type !== null) {
+ $params['mime-type'] = 'application/octet-stream';
+ }
+
// NOTE: These files have a view policy which prevents normal access. They
// are only accessed through the storage engine.
$chunk_data = PhabricatorFile::newFromFileData(
$data,
- array(
- 'name' => $file->getMonogram().'.chunk-'.$chunk->getID(),
- 'viewPolicy' => PhabricatorPolicies::POLICY_NOONE,
- 'mime-type' => $mime_type,
- ));
+ $params);
$chunk->setDataFilePHID($chunk_data->getPHID())->save();
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
@@ -251,6 +251,11 @@
$file->setMimeType('application/octet-stream');
$chunked_hash = idx($params, 'chunkedHash');
+
+ // Get rid of this parameter now; we aren't passing it any further down
+ // the stack.
+ unset($params['chunkedHash']);
+
if ($chunked_hash) {
$file->setContentHash($chunked_hash);
} else {

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 20, 3:59 AM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7385016
Default Alt Text
D17651.id42451.diff (1 KB)

Event Timeline