# File Sharing

When using navigator.share() API, the user can customize the share behaviour based on the parameters.&#x20;

If you want to share a normal text on any platform.

```
navigator.share({
  type: "url"
  url: "Hello World! You can open this link. 
  https://i.imgur.com/HSLFU3i.jpeg", // text or url to be shared
});
```

To share a file as a doc, image, etc.

```
navigator.share({
  type: "file"
  url: "https://i.imgur.com/HSLFU3i.jpeg",
  extension: "jpg", //extension of the file
  text: "Hello World!"// text to be shared with the file
});
```

Add the following parameters to share the file:

* **type**: “file” or “url”
  * file: Indicate the sharing of the file
  * url: Indicate the sharing of the link
* **extension**(Only for Android): When you are sharing a file, keep in mind that you add a proper extension. Don’t include a full stop while writing the extension of the file. For example, doc, docx, and pdf.
* **url**: Link of the respective file or url to be shared.&#x20;
* **text (**&#x4F;ptiona&#x6C;**)**: A message or description of the file being shared.


---

# Agent Instructions: 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.webtonative.com/javascript-apis/file-sharing.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.
