1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-13 18:32:41 +01:00
phorge-phorge/src/applications/files/controller/PhabricatorFileUploadController.php

31 lines
723 B
PHP
Raw Normal View History

2011-01-23 03:33:00 +01:00
<?php
final class PhabricatorFileUploadController extends PhabricatorFileController {
2011-01-23 03:33:00 +01:00
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
2011-01-23 03:33:00 +01:00
if ($request->isFormPost()) {
$file = PhabricatorFile::newFromPHPUpload(
idx($_FILES, 'file'),
array(
'name' => $request->getStr('name'),
'authorPHID' => $user->getPHID(),
));
2011-01-23 03:33:00 +01:00
return id(new AphrontRedirectResponse())->setURI($file->getBestURI());
2011-01-23 03:33:00 +01:00
}
$panel = new PhabricatorFileUploadView();
$panel->setUser($user);
2011-01-23 03:33:00 +01:00
return $this->buildStandardPageResponse(
array($panel),
array(
'title' => 'Upload File',
));
}
}