> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# UploadOptions

> UploadOptions — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)::<wbr />[filesystem](https://docs.kinetica.com/content/api/rust/filesystem/index.md)
[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/options.rs#L21-L36)&#x20;

<pre>`pub struct UploadOptions {    pub recursive: bool,    pub ttl: i32,}`</pre>

Options for file upload operations.

## Example

```rust theme={null}
use gpudb_api::filesystem::UploadOptions;

// Create default options (recursive search, no TTL)
let options = UploadOptions::default();

// Create custom options
let options = UploadOptions::new()
    .with_recursive(true)
    .with_ttl(3600); // Files expire in 1 hour
```

Fields
`recursive: bool`

Whether to search subdirectories for the files to upload. Default: `true`This applies to glob patterns and to a directory given by name, which uploads its files as `<directory>/*` does. A file given by name is uploaded alone either way: `upload("/data/file.csv")` uploads that file, not also `/data/sub/file.csv`. Files found below a pattern’s or directory’s base go to the same path below the remote directory.

`ttl: i32`

Time-to-live value for uploaded files in seconds. A value of -1 or 0 means no expiration. Default: `-1`

## Implementations

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/options.rs#L47-L76)
impl [UploadOptions](https://docs.kinetica.com/content/api/rust/filesystem/struct.UploadOptions.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/options.rs#L49-L51)
pub fn [new](#method.new)() -> Self

Creates a new `UploadOptions` with default values.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/options.rs#L55-L58)
pub fn [with\_recursive](#method.with_recursive)(self, recursive: [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)) -> Self

Sets whether patterns and directories given by name are searched below their own level. See [`UploadOptions::recursive`](https://docs.kinetica.com/content/api/rust/filesystem/struct.UploadOptions#structfield.recursive).

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/options.rs#L62-L65)
pub fn [with\_ttl](#method.with_ttl)(self, ttl: [i32](https://doc.rust-lang.org/1.98.1/std/primitive.i32.html)) -> Self

Sets the TTL (time-to-live) in seconds for uploaded files. Use -1 or 0 for no expiration.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/options.rs#L68-L70)
pub fn [is\_recursive](#method.is_recursive)(\&self) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Returns whether recursive search is enabled.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/options.rs#L73-L75)
pub fn [ttl](#method.ttl)(\&self) -> [i32](https://doc.rust-lang.org/1.98.1/std/primitive.i32.html)

Returns the TTL value.

## Trait Implementations

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/options.rs#L20)
impl [Clone](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html) for [UploadOptions](https://docs.kinetica.com/content/api/rust/filesystem/struct.UploadOptions.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/options.rs#L20)
fn [clone](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#tymethod.clone)(\&self) -> [UploadOptions](https://docs.kinetica.com/content/api/rust/filesystem/struct.UploadOptions.md)

Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#tymethod.clone)

1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/142757)) · [Source](https://doc.rust-lang.org/1.98.1/src/core/clone.rs.html#245-247)
fn [clone\_from](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#method.clone_from)(\&mut self, source: \&Self)

Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#method.clone_from)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/options.rs#L20)
impl [Debug](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html) for [UploadOptions](https://docs.kinetica.com/content/api/rust/filesystem/struct.UploadOptions.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/options.rs#L20)
fn [fmt](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html#tymethod.fmt)(\&self, f: \&mut [Formatter](https://doc.rust-lang.org/1.98.1/core/fmt/struct.Formatter.html)\<'\_>) -> [Result](https://doc.rust-lang.org/1.98.1/core/fmt/type.Result.html)

Formats the value using the given formatter. [Read more](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html#tymethod.fmt)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/options.rs#L38-L45)
impl [Default](https://doc.rust-lang.org/1.98.1/core/default/trait.Default.html) for [UploadOptions](https://docs.kinetica.com/content/api/rust/filesystem/struct.UploadOptions.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/options.rs#L39-L44)
fn [default](https://doc.rust-lang.org/1.98.1/core/default/trait.Default.html#tymethod.default)() -> Self

Returns the “default value” for a type. [Read more](https://doc.rust-lang.org/1.98.1/core/default/trait.Default.html#tymethod.default)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.