Controllers\xAPI\DocumentController::getPostContent PHP Method

getPostContent() public method

Checks for files, then retrieves the stored param.
public getPostContent ( String $name ) : Array
$name String Field name
return Array
    public function getPostContent($name)
    {
        if (\Input::hasFile($name)) {
            $content = \Input::file($name);
            $contentType = $content->getClientMimeType();
        } else {
            if (\LockerRequest::getContent()) {
                $content = \LockerRequest::getContent();
                $contentType = \LockerRequest::header('Content-Type');
                $isForm = $this->checkFormContentType($contentType);
                if (!$contentType || $isForm) {
                    $contentType = is_object(json_decode($content)) ? 'application/json' : 'text/plain';
                }
            } else {
                \App::abort(400, sprintf('`%s` was not sent in this request', $name));
            }
        }
        return ['content' => $content, 'contentType' => $contentType];
    }