Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions .llms-snapshots/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1918,16 +1918,13 @@ The `data` parameter is the file you want to upload. This is a `Blob`, typically
The `uploadFile` function provides various options, including:

* `filename`: By default, Juno uses the file's filename. You can overwrite this and provide a custom filename. Example: `myimage.jpg`.
* `fullPath`: Juno will automatically compute the `fullPath`, which is the **unique** path that is used to make the asset available on the internet. The `fullPath` is the filename prefixed with `/` plus the related collection key. Example: `/images/myimage.jpg`.
* `fullPath`: The unique path where the asset will be stored and accessed. 👉 See ([What is a `fullPath`?](#what-is-a-fullpath)) for details and examples.
* `headers`: The headers can affect how the browser handles the asset. If no headers are provided Juno will infer the `Content-Type` from the file type.
* `encoding`: The type of encoding for the file. For example, `identity` (raw) or `gzip`.

**Note:**

* Uploading a file with the same name as an existing file will overwrite the previous file (assuming the uploader has write access to the previous file).

* URL encoding is currently not supported on the Internet Computer. Therefore, it's important to keep in mind that your `filename` should not be encoded. That is why the library decodes the `filename` automatically.


#### Returns

Expand All @@ -1937,6 +1934,32 @@ The function returns the uploaded asset key as an object with the following fiel
* `name`: The name of the asset (typically the filename). Example: `myimage.jpg`.
* `downloadUrl`: The URL to access the asset on the web or to download it. This URL can be used in a browser or embedded directly in HTML elements like `<img>` or `<a>`.

#### What is a `fullPath`?

The `fullPath` is the **unique path** of an asset within your Satellite's storage. It determines the asset’s public-facing URL and is used throughout the SDK to identify, retrieve, list, or delete the asset.

It always starts with a **slash**, and follows the structure:

```
/collection/filename
```

For example, uploading a file to the `"images"` collection with the filename `"logo.png"` results in:

```
/images/logo.png
```

#### Key points

* If the asset is **not part of the frontend**, the `fullPath` always includes the **collection** name.
* By default, the `fullPath` is automatically derived from the uploaded file's name (e.g. `/images/photo.jpg`).
* You can override the path using a custom filename. These are both valid:
* `/collection/hello.jpg`
* `/collection/my/sub/path/hello.jpg`
* The `fullPath` is effectively the **asset key** used in Juno Storage.
* ⚠️ Uploading a file to an existing `fullPath` will **overwrite** the existing file.

---

## Upload blob
Expand Down Expand Up @@ -3241,6 +3264,16 @@ It’s a great reference for more advanced setups and multi-collection coordinat
* [Configuration Reference](/docs/reference/configuration.md)
* [Datastore Collections](/docs/build/datastore/collections.md)

---

## Crate Docs

These crates are used to build and extend serverless functions in Rust with Juno:

* [junobuild-satellite](https://docs.rs/junobuild-satellite): Core features and runtime for building a Satellite in Rust, including hooks, assertions, and datastore integration.
* [junobuild-macros](https://docs.rs/junobuild-macros): Procedural macros for declaratively attaching hooks and assertions (e.g., `#[assert_set_doc]`, `#[on_delete_doc]`).
* [junobuild-utils](https://docs.rs/junobuild-utils): Utility helpers for working with documents, including data encoding, decoding, and assertion context handling.

# Using Juno with AI

If you're using AI to build with Juno, you can use our `llms.txt` files to help AI tools better understand the platform.
Expand Down
30 changes: 27 additions & 3 deletions docs/build/storage/development.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ The `data` parameter is the file you want to upload. This is a `Blob`, typically
The `uploadFile` function provides various options, including:

- `filename`: By default, Juno uses the file's filename. You can overwrite this and provide a custom filename. Example: `myimage.jpg`.
- `fullPath`: Juno will automatically compute the `fullPath`, which is the **unique** path that is used to make the asset available on the internet. The `fullPath` is the filename prefixed with `/` plus the related collection key. Example: `/images/myimage.jpg`.
- `fullPath`: The unique path where the asset will be stored and accessed. 👉 See [What is a `fullPath`?](#what-is-a-fullpath) for details and examples.
- `headers`: The headers can affect how the browser handles the asset. If no headers are provided Juno will infer the `Content-Type` from the file type.
- `encoding`: The type of encoding for the file. For example, `identity` (raw) or `gzip`.

:::note

- Uploading a file with the same name as an existing file will overwrite the previous file (assuming the uploader has write access to the previous file).

- URL encoding is currently not supported on the Internet Computer. Therefore, it's important to keep in mind that your `filename` should not be encoded. That is why the library decodes the `filename` automatically.

:::
Expand All @@ -50,6 +48,32 @@ The function returns the uploaded asset key as an object with the following fiel
- `name`: The name of the asset (typically the filename). Example: `myimage.jpg`.
- `downloadUrl`: The URL to access the asset on the web or to download it. This URL can be used in a browser or embedded directly in HTML elements like `<img>` or `<a>`.

#### What is a `fullPath`?

The `fullPath` is the **unique path** of an asset within your Satellite's storage. It determines the asset’s public-facing URL and is used throughout the SDK to identify, retrieve, list, or delete the asset.

It always starts with a **slash**, and follows the structure:

```
/collection/filename
```

For example, uploading a file to the `"images"` collection with the filename `"logo.png"` results in:

```
/images/logo.png
```

#### Key points

- If the asset is **not part of the frontend**, the `fullPath` always includes the **collection** name.
- By default, the `fullPath` is automatically derived from the uploaded file's name (e.g. `/images/photo.jpg`).
- You can override the path using a custom filename. These are both valid:
- `/collection/hello.jpg`
- `/collection/my/sub/path/hello.jpg`
- The `fullPath` is effectively the **asset key** used in Juno Storage.
- ⚠️ Uploading a file to an existing `fullPath` will **overwrite** the existing file.

---

## Upload blob
Expand Down