> 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/uploadfilewithsignedurl.md).

# uploadFileWithSignedUrl()

## Syntax

```javascript
uploadFileWithSignedUrl(file: File, options: UploadFileWithSignedUrlOptions)
```

The method used to upload files in Eueno. We have two types to upload: encrypted and unencrypted.

## Parameters

<table><thead><tr><th width="144">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>options</td><td>UploadFileWithSignedUrlOptions</td><td>Yes</td><td></td></tr></tbody></table>

Type `UploadFileOptions` has the structure like this:

```javascript
interface UploadFileWithSignedUrlOptions {
  uploadUrl: string;
  uploadTorrentUrl: string;
  exportedKey?: string; //Require if encrypt
}
```

## Example

<pre class="language-javascript"><code class="lang-javascript">import {UploadFileWithSignedUrlOptions} from "@eueno/lib-browser";

const uploadFile = async () => {
   const file = files[0];
   const uploadUrl = "https://upload-service.eueno.io/upload?signature=eyJhbGciOiJSUzI1Ni..."
   const uploadTorrentUrl: "https://upload-service.eueno.io/upload?signature=eyJhbGciOiJSUzI1NiIsInR..."
   const exportedKey = "4R2Bw-kz9DnWA5FEcoopIsPhZZ5PswLBvtPwll6ejkU"
<strong>   const options = {
</strong>      uploadUrl,
      uploadTorrentUrl,
      exportedKey   
   }
   
   const response = await uploadFileWithSignedUrl(file, options);
    
    console.log(response);
 };

</code></pre>

Response of example:

<pre class="language-javascript"><code class="lang-javascript">{
    data: {
        Hash: "QmQL923LcmRn6wSxgN7Yr6w2M2xBz8r4tpPxaatq3S45Z3",
<strong>        Name: "puz.png",
</strong>        Size: "51625",
    }
    status: 200
}
</code></pre>
