Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15409283
D17651.id42451.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D17651.id42451.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D17651: Correct two parameter strictness issues with file uploads
Attached
Detach File
Event Timeline
Log In to Comment