src/Server.php
protected function outputAttachSuccess()
    {
        if ($this->returnType === 'image') {
            $this->outputImage();
        }

        if ($this->returnType === 'json' || $this->returnType === 'none') {
            header('Content-type: application/json; charset=UTF-8');
            echo json_encode(['success' => 'attached']);
        }

        if ($this->returnType === 'jsonp') {
            $data = json_encode(['success' => 'attached']);
            echo $_REQUEST['callback'] . "($data, 200);";
        }

        if ($this->returnType === 'redirect') {
            $url = $_REQUEST['return_url'];
            header("Location: $url", true, 307);
            echo "You're being redirected to <a href='{$url}'>$url</a>";
        }
    }
protected function outputAttachSuccess()
    {
        if ($this->returnType === 'image') {
            $this->outputImage();
        }

        if ($this->returnType === 'json' || $this->returnType === 'none') {
            header('Content-type: application/json; charset=UTF-8');
            echo json_encode(['success' => 'attached']);
        }

        if ($this->returnType === 'jsonp') {
            $data = json_encode(['success' => 'attached']);
            echo $_REQUEST['callback'] . "($data, 200);";
        }

        if ($this->returnType === 'redirect') {
            $url = $_REQUEST['return_url'];
            header("Location: $url", true, 307);
            echo "You're being redirected to <a href='{$url}'>$url</a>";
        }
    }
protected function outputAttachSuccess ( ) { if ( $ this -> returnType === 'image' ) { $ this -> outputImage ( ) ; } if ( $ this -> returnType === 'json' || $ this -> returnType === 'none' ) { header ( 'Content-type: application/json; charset=UTF-8' ) ; echo json_encode ( [ 'success' => 'attached' ] ) ; } if ( $ this -> returnType === 'jsonp' ) { $ data = json_encode ( [ 'success' => 'attached' ] ) ; echo $ _REQUEST [ 'callback' ] . "($data, 200);" ; } if ( $ this -> returnType === 'redirect' ) { $ url = $ _REQUEST [ 'return_url' ] ; header ( "Location: $url" , true , 307 ) ; echo "You're being redirected to <a href='{$url}'>$url</a>" ; } }
Output on a successful attach
Output on a successful attach