# UploadFileBehaviorBase

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-interactions-custom/struct-uploadfilebehaviorbase/

**struct** · [`ferroui-xaml-interactions-custom`](/docs/0.5.0/api/ferroui-xaml-interactions-custom/) · v0.5.0

```rust
struct UploadFileBehaviorBase
```

Base class for behaviors that upload a file to a URL.

The class is abstract: a deriving class calls `execute` when its event fires.

Deviation (DEVIATIONS.md, Behaviors): the reference posts the file with `HttpClient` and runs
the command with the response. The framework has no HTTP client service, so the port sends no
request: `execute` checks what the reference checks (enabled, a command, a
file path, a URL, an existing file) and then ends as the reference ends when the request fails
(the error is ignored and the command does not run).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/file_upload/upload_file_behavior_base.rs#L20)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`file_path_property`](#function-file_path_property)
- [`url_property`](#function-url_property)
- [`construct`](#function-construct)
- [`file_path`](#function-file_path)
- [`set_file_path`](#function-set_file_path)
- [`url`](#function-url)
- [`set_url`](#function-set_url)
- [`execute`](#function-execute)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/file_upload/upload_file_behavior_base.rs#L24)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<UploadFileBehaviorBase>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/file_upload/upload_file_behavior_base.rs#L24)

<a id="function-file_path_property"></a>

### file_path_property

```rust
fn file_path_property() -> &'static StyledProperty<Option<String>>
```

Identifies the `FilePath` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/file_upload/upload_file_behavior_base.rs#L27)

<a id="function-url_property"></a>

### url_property

```rust
fn url_property() -> &'static StyledProperty<Option<String>>
```

Identifies the `Url` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/file_upload/upload_file_behavior_base.rs#L27)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/file_upload/upload_file_behavior_base.rs#L54)

<a id="function-file_path"></a>

### file_path

```rust
fn file_path(self: &Self) -> Option<String>
```

Gets or sets the path of the file to upload. This is a property of the object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/file_upload/upload_file_behavior_base.rs#L59)

<a id="function-set_file_path"></a>

### set_file_path

```rust
fn set_file_path(self: &Self, value: Option<String>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/file_upload/upload_file_behavior_base.rs#L63)

<a id="function-url"></a>

### url

```rust
fn url(self: &Self) -> Option<String>
```

Gets or sets the destination URL. This is a property of the object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/file_upload/upload_file_behavior_base.rs#L68)

<a id="function-set_url"></a>

### set_url

```rust
fn set_url(self: &Self, value: Option<String>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/file_upload/upload_file_behavior_base.rs#L72)

<a id="function-execute"></a>

### execute

```rust
fn execute(self: &Self, sender: Option<&BoxedValue>, _parameter: Option<&BoxedValue>)
```

Executes the upload using the provided sender (the control that triggered the behavior)
and command parameter.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/file_upload/upload_file_behavior_base.rs#L78)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`StyledElementBehaviorImplExt`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementbehaviorimplext/)
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<UploadFileBehaviorBase>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`StyledElementBehaviorImpl`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementbehaviorimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
