@mcp-z/server
    Preparing search index...

    Interface FileServingRouterOptions

    Options for creating a file serving Express router

    interface FileServingRouterOptions {
        contentDisposition?: "inline" | "attachment";
        contentType: string | ((filename: string) => string);
    }
    Index

    Properties

    contentDisposition?: "inline" | "attachment"

    Content-Disposition header value

    • 'attachment': Forces download with filename
    • 'inline': Displays in browser when possible
    'attachment'
    
    contentType: string | ((filename: string) => string)

    Content-Type header value or function to determine it from filename Examples:

    • Static: 'application/pdf'
    • Dynamic: (filename) => filename.endsWith('.pdf') ? 'application/pdf' : 'text/plain'