Skip to content

feat(multipart): demonstrate optional text fields and missing files - #1509

Merged
robjtede merged 1 commit into
actix:mainfrom
NginxL:e08/multipart-optional-text
Dec 6, 2026
Merged

robjtede merged 1 commit into
actix:mainfrom
NginxL:e08/multipart-optional-text

Conversation

@NginxL

@NginxL NginxL commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #410.

Extends the multipart example to demonstrate both parts of the question:

  • files: Vec<TempFile> and form.files.is_empty() show whether any file parts were submitted.
  • pub_time: Option<Text<String>> shows how to read an optional text field alongside files.
  • The browser form and README now include pub_time, and the README has a curl example with repeated file fields.

No new dependencies were added; Text is part of the existing actix-multipart dependency.

Validation

  • rustfmt --edition 2024 --check forms/multipart/src/main.rs.
  • git diff --check.
  • Verified Option<Text<String>> and Vec<TempFile> against the actix-multipart 0.8 MultipartForm documentation for optional/list fields and text fields.

Gaps

  • cargo build/cargo test was not run because crate sources were absent from the local Cargo registry and dependency downloads were prohibited. Upstream CI should compile the example.
  • No live HTTP upload was performed.

AI disclosure

This example update was prepared with AI assistance (DSH). The extractor types were checked against the actix-multipart 0.8 API documentation.

AI-assisted: DSH
Signed-off-by: NginxL <8777777+NginxL@users.noreply.github.com>
@robjtede
robjtede marked this pull request as ready for review December 6, 2026 14:58
@robjtede
robjtede enabled auto-merge December 6, 2026 14:58
@robjtede
robjtede disabled auto-merge December 6, 2026 14:58
@robjtede
robjtede enabled auto-merge December 6, 2026 14:59
@robjtede
robjtede added this pull request to the merge queue Dec 6, 2026
Merged via the queue into actix:main with commit 1b202de Dec 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

how to check file param exists ?

2 participants