top of page

Report Download Filenames: Treat Content-Disposition as a Suggestion

Nov 14
3 min read

An automated report download arrives with a filename that looks like a folder path, uses an unexpected extension or loses accented characters. Preserve the original response, but do not let its suggested name decide where the application writes a file. Separate file identity, display naming and storage policy.


Original concept: Report Download Filenames: Treat Content-Disposition as a Suggestion
Original explanatory concept; not a live software screen or available product feature.

Key takeaways A supplied download filename is advisory. Parse it correctly, constrain the storage destination and validate the actual file format before handing a report to another system.

1. Read the header without trusting a path



RFC 6266 describes Content-Disposition filename information as a suggested name for saving the payload. It explicitly warns recipients about filesystem safety. A remote filename should never become unrestricted permission to select a local directory. Keep the report inside an application-controlled destination and apply the receiving system's approved filename policy.


Preserve the original header in a restricted diagnostic record when permitted. Record the request endpoint, date, response status and report identifier alongside the stored object. This allows support to explain a renamed file without relying on the visible filename as the only evidence of identity. Keep credentials and customer data out of shared examples.


2. Decode names before applying a local policy


The filename and filename* parameters are not interchangeable strings. The extended form supports encoded characters; RFC 6266 recommends preferring filename* when both forms are present and supported. Use a maintained parser that implements the relevant syntax rather than splitting the header at every semicolon or percent-decoding the entire response value indiscriminately.


After parsing, apply a separate local naming rule. Handle path separators, control characters, reserved names and unsupported characters according to the target platform. Make the final display name predictable for operators, and retain the original suggested name as metadata if policy permits. Document any change rather than silently pretending that the sender supplied your replacement name.


Parse: Interpret filename and filename* using a suitable parser.; Constrain: Apply local filename and destination policy.; Validate: Check content format, identity and collisions before acceptance.
Original explanatory concept; not a live software screen or available product feature.

3. Check format and collision behaviour


A filename extension does not establish the content's format, safety or suitability for import. Check the documented response media type and the actual file structure using the approved receiving application. A file called a spreadsheet might instead contain an error document. Do not open unexpected executable content simply to see whether the download worked.


Define what happens when two reports have the same suggested name. An unattended download should not overwrite an earlier accepted record without an explicit retention rule. Use a controlled unique storage identifier, with a human-readable display name kept separately. Confirm access permissions and retention requirements for the report's actual contents.


4. Work through a hypothetical export


Imagine two shift reports both arrive as report.csv. The first covers the morning and the second covers the afternoon. Saving each to the same path could lose the earlier evidence even though both transfers succeeded. A storage record with a unique identifier and explicit reporting interval keeps the files distinguishable.


Now suppose the next response suggests a name containing folder separators. The receiving system should apply its controlled storage policy, rather than following that path. Test this safely with artificial data and a dedicated test directory. Confirm that malformed names produce a clear warning or documented replacement, and that no file escapes the approved destination.


5. Recommended related solutions


Start with the ProSight Software platform overview when defining reporting needs. Use ProSight Custom to discuss the actual export route, receiving application and acceptance tests. Confirm the deployed interface; this article does not advertise a built-in file sanitisation feature or a particular export format as universally available.


The related HTTP 206 guide explains why a successful download may contain only part of a dataset. Together, naming, completeness and source reconciliation provide a stronger handover than checking that a file appeared in a folder. Send the integration team a sanitised header, the expected format and the required retention behaviour.




Observation

Check next

Same name twice

Check overwrite policy

Folder separators in name

Constrain destination

Unexpected extension

Validate actual format


Frequently asked questions


Can I trust a .csv extension?


No. Validate the documented content format and receiving parser; the filename alone is insufficient.


Can I discard the original name after renaming?


Follow the application's retention policy. Keeping permitted source-name metadata can help investigate later mismatches.


Primary technical reference



Need help with your application?










Comments


prosight-software-logo (1).png
bottom of page