getRequest(); $user = $request->getUser(); $data = file_get_contents('php://input'); $name = $request->getStr('name'); $file = PhabricatorFile::newFromFileData( $data, array( 'name' => $request->getStr('name'), 'authorPHID' => $user->getPHID(), )); $view = new AphrontAttachedFileView(); $view->setFile($file); return id(new AphrontAjaxResponse())->setContent( array( 'phid' => $file->getPHID(), 'html' => $view->render(), )); } }