> 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eueno.io/eueno-libraries/eueno-lib-browser/uploadfilewithsignedurl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
