[wp-hackers] Plugin zip problem on wordpress.org

Callum Macdonald lists.automattic.com at callum-macdonald.com
Thu Nov 15 00:20:13 GMT 2007


Jeremy Visser wrote:
> On 14/11/2007, at 7:06 PM, Callum Macdonald wrote:
>> Jeremy Visser wrote:
>>> It actually downloads as wordpress-2.3.1.tar.gz if you do it with 
>>> Firefox. That's because of the Content-Disposition header sent by 
>>> the web server. Have a look:
>>>> Content-Disposition: attachment; filename=wordpress-2.3.1.tar.gz
>>> This tells the browser what filename to save the file as, but 
>>> unfortunately wget doesn't support that header, for some reason. I 
>>> guess it makes it easier to predict the filename when running it 
>>> from a script; but I guess if you were scripting it, you'd use the 
>>> -O argument to force it to have a particular filename.
>> You can save it with whatever filename you choose, but simply 
>> downloading latest.tar.gz doesn't tell you which version it is, 
>> unless you check wp-includes/version.php. If it were to redirect to 
>> 2.3.1.tgz then you'd know the version you were getting, and could 
>> therefore figure out which was the latest...
> What I'm saying is that the Content-Disposition header is already 
> doing the _same_thing_ that a redirect would be doing — it's just that 
> wget doesn't support the header. If it supported the 
> Content-Disposition header and only downloading headers, then you'd 
> know the version you were getting, and could therefore figure out 
> which was the latest, simply by running a "HEAD /latest.tar.gz HTTP/1.1"
On the other hand, if wp.org returned a redirect, all clients would 
work, including wget! ;-)

C.



More information about the wp-hackers mailing list