Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15390226
D10164.id24485.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
D10164.id24485.diff
View Options
diff --git a/src/applications/files/conduit/FileUploadConduitAPIMethod.php b/src/applications/files/conduit/FileUploadConduitAPIMethod.php
--- a/src/applications/files/conduit/FileUploadConduitAPIMethod.php
+++ b/src/applications/files/conduit/FileUploadConduitAPIMethod.php
@@ -14,6 +14,8 @@
return array(
'data_base64' => 'required nonempty base64-bytes',
'name' => 'optional string',
+ 'viewPolicy' => 'optional valid policy string or <phid>',
+ 'canCDN' => 'optional bool',
);
}
@@ -29,15 +31,26 @@
protected function execute(ConduitAPIRequest $request) {
$data = $request->getValue('data_base64');
$name = $request->getValue('name');
- $data = base64_decode($data, $strict = true);
+ $can_cdn = $request->getValue('canCDN');
+ $view_policy = $request->getValue('viewPolicy');
+
$user = $request->getUser();
+ $data = base64_decode($data, $strict = true);
+
+ if (!$view_policy) {
+ $view_policy = PhabricatorPolicies::getMostOpenPolicy();
+ }
$file = PhabricatorFile::newFromFileData(
$data,
array(
'name' => $name,
'authorPHID' => $user->getPHID(),
+ 'viewPolicy' => $view_policy,
+ 'canCDN' => $can_cdn,
+ 'isExplicitUpload' => true,
));
+
return $file->getPHID();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 6:02 AM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7705417
Default Alt Text
D10164.id24485.diff (1 KB)
Attached To
Mode
D10164: file.upload set policy explicitly
Attached
Detach File
Event Timeline
Log In to Comment