public function upload($file)
    {
        $zip = new Zip();
        $zip->addFile($file);

        $response = $this->browser->request('POST', 'file', json_encode(array('file' => base64_encode($zip->getContent()))));
        $content  = json_decode($response->getContent(), true);

        if (!isset($content['value'])) {
            throw new LibraryException('Malformed expression, no key "value" in response: '.$response->getContent());
        }

        $file = $content['value'];

        $this->type($file);

        return $file;
    }