Help us shape the future of Go! Take the 2026 Go Developer Survey

disposition

package
v0.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package disposition builds safe Content-Disposition attachment headers for client-facing download names (export and web.Ctx.Download).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attachment

func Attachment(filename string) string

Attachment returns an RFC 6266 attachment header for filename, sanitized by Sanitize. Non-ASCII names get an ASCII filename plus an RFC 5987 filename*.

func Sanitize

func Sanitize(name string) string

Sanitize returns a download-safe name: the last path element (either separator), without control (C0, C1, U+2028/2029) and format (bidi, zero-width) characters, with Windows-forbidden characters as "_", no leading dots, no trailing dots or spaces, a "_" before Windows device names, at most 200 characters keeping the extension; "download" when nothing is left.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL