Make WordPress Core

Opened 4 years ago

Last modified 22 months ago

#38231 new enhancement

Allow download_url to respect content-disposition header

Reported by: cklosows Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7
Component: HTTP API Keywords: has-patch
Focuses: Cc:


In #34938 it was proposed to use a filter in the wp_tempnam function which was rejected in favor of ignore the query string when downloading a file. This, however can still propose a problem when someone is the function to download a tokenized file where the path can be long.

In the case where the headers of the response provide a content-disposition header including a file name, it would be ideal to have the download_url function respect this file name and move the file name (which by default is the token in the path) to the file name requested.

Attachments (1)

38231.diff (810 bytes) - added by cklosows 4 years ago.

Download all attachments as: .zip

Change History (3)

4 years ago

#1 @cklosows
4 years ago

  • Keywords has-patch added

#2 @dd32
4 years ago

  • Component changed from Filesystem API to HTTP API
Note: See TracTickets for help on using tickets.