public function fromPath($path, $mime_type = false)
    {
        if (function_exists('curl_file_create')) {
            if ($mime_type) {
                $f = curl_file_create($path, $mime_type);
            } else {
                $f = curl_file_create($path);
            }
        } else {
            if ($mime_type) {
                $f = '@' . $path . ';type=' . $mime_type;
            } else {
                $f = '@' . $path;
            }
        }

        $data = array(
            'UPLOADCARE_PUB_KEY' => $this->api->getPublicKey(),
            'file' => $f,
        );
        $ch = $this->__initRequest('base');
        $this->__setRequestType($ch);
        $this->__setData($ch, $data);
        $this->__setHeaders($ch);

        $data = $this->__runRequest($ch);
        $uuid = $data->file;
        return new File($uuid, $this->api);
    }