# getDetailUnencryptedFile()

This method is used to get detail of an unencrypted file.

### Syntax

```javascript
getDetailUnencryptedFile: (
    token: string, 
    torrentUrl: string, 
    onProcess?: (torrent: any, remaining: any) => void
)
```

### Params

<table><thead><tr><th width="128">Name</th><th width="96">Type</th><th width="100">Required</th><th>Description</th></tr></thead><tbody><tr><td>token</td><td>string</td><td>Yes</td><td>The authentication token.</td></tr><tr><td>torrentUrl</td><td>string</td><td>Yes</td><td>Torren URL.</td></tr><tr><td>onProcess</td><td>function</td><td>No</td><td><p>This function is used to handle the process get a file. Param <code>torrent</code> is an object includes: </p><pre class="language-javascript"><code class="lang-javascript">{
    downloadSpeed,
    uploadSpeed,
    numPeers,
    progress,
}
</code></pre><p>The second param <code>remaining</code> is the time remaining to get this file.</p></td></tr></tbody></table>

### Example

```javascript
import { getDetailFile, getDetailUnencryptedFile } from "@eueno/lib-browser";
import { useDispatch, useSelector } from "react-redux";

const dispatch = useDispatch();
const getFile = async (id, token) => {
 try {
  const fileDetail = await getDetailFile(id);
    if (!fileDetail) {
      return console.error("File not found");
    }

    let bufferData;
 
    if (!fileDetail.encryptKey) {
      bufferData = await getDetailUnencryptedFile(
        token,
        fileDetail.torrentUrl,
        (torrent, remaining) => {
          dispatch(
            setTorrentInfo({
              download: torrent.downloadSpeed,
              upload: torrent.uploadSpeed,
              remain: remaining,
              peers: torrent.numPeers,
              progress: torrent.progress,
            })
          );
        }
      );
    }
    
 } catch (error) {
   console.log(error);
 }
};
```

### Response

This method returns buffer data. You can use some library as "render-media" to render data ([see example](https://docs.eueno.io/eueno-libraries/eueno-lib-browser/getdetailfile#example))
