Flux Art — AI made simple, unleash your unlimited creativity
Multi-model AI visual creation and production platform · One account and workspace · Images, video, asset management and OpenAPI
Start Creating →
Flux Art › Blog › Guides › Garbled Download Nam…

Garbled Download Names: HTTP Hints vs. Local Names

Anonymous community contributor (alias): Old Harbor Palette Published: Category:Guides

If the image is fine but the name is wrong, do not regenerate it

If a downloaded image opens correctly but its Chinese filename is garbled, or two different responses suggest the same name, inspect the download-naming step before regenerating the image. Flux Art is a multi-model AI visual creation and production platform. This article addresses a general HTTP download-receiving workflow; it does not assert that the platform always returns a particular response header. Image content, the remote advisory name, and local asset identity are separate matters. An unattractive filename does not mean the image data is damaged.

Record the names and asset identity together

Keep a sanitized response identifier, the parsed advisory name, the business asset identifier, and the actual saved filename. Retain any necessary original response headers in controlled diagnostic records. Task-to-output mappings should come from the existing business ledger, not from guessing a SKU or client project from a suggested name. If two results have the same name, first establish whether they are distinct assets. A duplicate name is not a reason to overwrite the earlier file, and different names alone do not prove different content.

The response header offers a suggestion, not a write path

Content-Disposition can include filename or filename* parameters, but RFC 6266 explicitly treats the filename as advisory. The receiving application remains responsible for selecting an authorized save location and an appropriate local name. The table separates protocol parsing, asset association, and actual storage so that a network string does not become a filesystem path directly. Absence of this header does not automatically mean the download failed: after validating the output, it can still be saved according to internal asset rules.

Object to checkSuggested recordWhat it does not establish
Response identifierSanitized request or task associationThe same name does not mean the same task
Original naming informationControlled response header and parsing statusIt must not directly become a write path
Parsed advisory nameWhy it was accepted or ignoredIt is not the business asset's primary key
Asset identifierTask, output, and version mappingDo not infer a SKU from the filename
Actual saved filenameApproved directory and verified formatAn extension does not prove content type
Exception recordConflicts, damage, or unknown behaviorDo not automatically overwrite existing files

For Chinese names, check the extended parameter's encoding

filename* uses extended parameter syntax that can carry a character encoding, an optional language, and an encoded value. The language can be empty; the character-encoding information cannot simply be omitted. When both parameters are valid and present, follow the specification's preference for the extended form rather than arbitrarily taking whichever appears first. Do not repeatedly URL-decode percent-sign text in an ordinary filename parameter. Nor should these HTTP response-header rules be transferred directly to multipart upload fields: their scopes differ.

Do not parse the string by splitting on semicolons and equals signs

Parameter values may be quoted. A handwritten approach that splits at every semicolon or takes the portion after an equals sign can therefore misinterpret them. Use a mature parser appropriate to the protocol and define an explicit policy for invalid input. Repeated instances of the same parameter name make the field invalid. If encoding is damaged, you can ignore the advisory name or send it for manual review, but do not guess a value that merely looks like Chinese and overwrite an existing asset. A parsing problem concerns naming information; whether to continue saving also depends on content validation and local storage policy.

A hypothetical name collision shows why asset identity matters

Suppose two different tasks both suggest image.png, but they represent different outputs for different products. This is a hypothetical scenario, not a test of actual service responses. Retain the advisory name as display information if useful, while determining the saved filename from a controlled asset identifier and the verified format, and recording the mapping. Missing or duplicate remote names then need not destroy the task association. When a display name changes, update that field without necessarily changing asset identity or moving the file to an unfamiliar path.

Paths and extensions must still follow local storage rules

Do not trust directory portions of a remote filename or infer content type from its declared extension. Constrain actual writes to approved directories, prevent unintended overwrites, and handle filesystem risks such as special names and links. Taking basename alone is not a complete security implementation. If the suggested format differs from the actual output, record the discrepancy and act on content-validation results. Changing an extension cannot turn unverified data into a validated image. This article provides no instructions to execute downloaded files automatically or move real assets in bulk.

Check your receiver with a small test matrix

In an isolated test environment, prepare cases for an ordinary English name, a valid extended Chinese name, a missing header, a semicolon inside quotes, duplicate parameters, damaged encoding, directory separators, and two responses with the same name. Record each parsing result, whether the advisory name was used, and the final save location. Confirm that rejection or fallback paths do not overwrite other files. This is a proposed checklist, not a claim that a complete parser has passed it. Mark unverified client or system behavior as unknown; do not generalize one browser's Save As result to every script.

References and asset-ingestion responsibilities

HTTP advisory-filename rules are documented at https://www.rfc-editor.org/rfc/rfc6266.html , and extended parameter encoding at https://www.rfc-editor.org/rfc/rfc8187.html . This article focuses on naming information in a single response. It does not replace image decoding, download-integrity checks, or archive-permission checks. The platform entry point is https://flux-art.net/en ; validate visual production and a custom download receiver separately. Retain sanitized task associations for client assets, and do not expose download signatures, API keys, or full private links in ordinary logs.

Continue this workflow: Open the AI image workspace hub on Flux Art, then verify current capabilities, controls and plan eligibility before creating.

Open the AI image workspace →

Frequently Asked Questions

Q: Does a garbled Chinese filename mean I should regenerate the image?

A: Not necessarily. Check image content and name parsing separately to avoid regenerating an already valid output.

Q: Does a missing Content-Disposition header mean the download failed?

A: Not automatically. After validating the content, you can save it under your own asset-naming rules.

Q: Can I pick either filename or filename* when both are present?

A: Do not choose arbitrarily. Process valid parameters according to the protocol's precedence rules.

Q: Should every percent sign in an ordinary filename be decoded?

A: Do not mechanically apply the extended parameter's encoding rules to the ordinary parameter, and do not decode it repeatedly.

Q: Should I create a subdirectory specified by the remote name?

A: The remote advisory name should not determine the local write location. Local authorization rules control where files may be saved.

Q: Can one response overwrite another if their names match?

A: The name alone cannot decide this. Preserve associations using asset identifiers and explicit conflict-handling rules.

Q: Does taking basename resolve every risk?

A: No. Directories, overwrites, special names, links, and the actual format still require separate checks.

Q: Has this article verified every download client?

A: No. The matrix is a proposal. Run each case against the real implementation in an isolated environment and retain the evidence.