Bug 18384 - Web Inspector: resources should optionally use content-disposition filename
Summary: Web Inspector: resources should optionally use content-disposition filename
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Matt Baker
Keywords: InRadar
Depends on:
Reported: 2008-04-09 07:15 PDT by Alexander Romanovich
Modified: 2016-12-13 15:34 PST (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Romanovich 2008-04-09 07:15:03 PDT
I have several instances of the same file included in a web page. Each instance generates different content depending on a variable passed in. However, since it is the same file, WebKit's web inspector shows the same file name repeatedly in the resource list. I cannot tell which is which until I view each one.

Since I am sending the header "Content-Disposition: inline; filename=foo", which is different for each of these instances, it would be desirable if the filename provided in the header could be used in the resource list so that the list makes more apparent which file is which.
Comment 1 Alexander Romanovich 2008-04-09 19:46:03 PDT
Example posted at: http://www.sirensclef.com/safari_resources/
Comment 2 Timothy Hatcher 2008-04-10 15:21:34 PDT
This is interesting! We might be able to show the content disposition then the real file name in parenthesis. Or visa-versa.
Comment 3 Alexander Romanovich 2008-04-10 16:39:51 PDT
That's a good idea. Thinking about this further, if I don't send a content-disposition filename in the header, it would at least be useful to show the whole request URI, because the query string would help identify which instance is which.

While this may not be the most useful feature for many people, those who are doing what I'm doing in that example, or in the more common case of using PHP to construct images on the fly, I feel it would certainly be useful. Thanks for considering.
Comment 4 Alexander Romanovich 2011-02-08 13:50:25 PST
It seems that the test case for this broke at some point, fixed.

Three years later, this still seems useful to implement, and would probably be a simple addition. Is there any interest in taking it on? My note about showing the query string seems reasonably addressed now, but the original content-disposition filename request still stands.
Comment 5 Alexey Proskuryakov 2011-02-08 23:46:04 PST
It is not easy to parse Content-Disposition, because there are multiple ways to encode a non-ASCII file name. But something nearly equivalent is exposed as suggestedFileName on ResourceResponse.
Comment 6 Radar WebKit Bug Importer 2014-12-17 11:23:24 PST
Comment 7 Sanford Selznick 2016-04-27 17:50:03 PDT
I can't believe this hasn't been fixed yet.  

Advanced servers store files in databases and the download URL does not match the file name.  Content-Disposition is the way to transmit that file name.  Honestly, these days users download lots of data from CGIs.  These data should be saved with a proper name as specified by the server.

This even works in curl.  (And Chrome and Firefox.)

Can someone please address this?