Make WordPress Core

Opened 5 years ago

Last modified 4 weeks ago

#38231 assigned enhancement

Allow download_url to respect content-disposition header

Reported by: cklosows Owned by: johnjamesjacoby
Milestone: 5.8 Priority: normal
Severity: normal Version: 4.7
Component: HTTP API Keywords: has-patch needs-testing
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 5 years ago.

Download all attachments as: .zip

Change History (4)

5 years ago

#1 @cklosows
5 years ago

  • Keywords has-patch added

#2 @dd32
5 years ago

  • Component changed from Filesystem API to HTTP API

#3 @johnjamesjacoby
4 weeks ago

  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to 5.8
  • Owner set to johnjamesjacoby
  • Status changed from new to assigned

Let's try to make this happen 5.8.

Note: See TracTickets for help on using tickets.