> For the complete documentation index, see [llms.txt](https://docs.eueno.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eueno.io/eueno-libraries/eueno-lib-browser/getcid.md).

# getCid()

## Syntax

```javascript
getCid(file: File, exportedKey?: string)
```

This method used to get `cidFile` and `cidTorrentFile`

## Parameters

<table><thead><tr><th width="169">Name</th><th width="173">Type</th><th width="108">Required</th><th>Description</th></tr></thead><tbody><tr><td>file</td><td>File</td><td>Yes</td><td>File upload</td></tr><tr><td>exportedKey</td><td>string</td><td>No</td><td>Require if file encrypted</td></tr></tbody></table>

## Example

```javascript
import {getCid} from "@eueno/lib-browser";

const getData = async () => {
   const file = files[0];
   const exportedKey = "4R2Bw-kz9DnWA5FEcoopIsPhZZ5PswLBvtPwll6ejkU"
   
   const response = await getCid(file, exportedKey);
    
    console.log(response);
 };

```

Response of example:

```javascript
{
    data: {
     cidFile: "QmWYXyKrnpd94hVr4rh84q3MLfLfSMrk1MmuAW2Uj3Dv6X"
     cidTorrentFile: "QmNxPpQkyK8x1ne3izWY7VRKw8LY7j4tVfaGfo5CMuuNpK"   
    },
    status: 200
}
```
