3 final class PholioImageUploadController
extends PholioController
{
5 public function handleRequest(AphrontRequest
$request) {
6 $viewer = $request->getViewer();
8 $phid = $request->getStr('filePHID');
9 $replaces_phid = $request->getStr('replacesPHID');
10 $title = $request->getStr('title');
11 $description = $request->getStr('description');
13 $file = id(new PhabricatorFileQuery())
15 ->withPHIDs(array($phid))
18 return new Aphront404Response();
21 if (!strlen($title)) {
22 $title = $file->getName();
25 $image = PholioImage
::initializeNewImage()
26 ->setAuthorPHID($viewer->getPHID())
29 ->setDescription($description)
32 $view = id(new PholioUploadedImageView())
35 ->setReplacesPHID($replaces_phid);
41 return id(new AphrontAjaxResponse())->setContent($content);