On Tue, 24 Aug 2004, Andy Turner wrote:

I would agree that slurping the entire file is a bad idea.

This whole project is, in hindsight, a bad idea.

This can be done more safely & easily in the Apache config.

Assume that the image tree lives in /Library/WebServer/Documents/photos, and is ordinarily accessible at the url <http://site/photos/>.

Do this in your shell:

    ln -s /Library/WebServer/Documents/photos{,-dl}

Do this in your httpd.conf:

    Alias /photo-dl /Library/WebServer/Documents/photos-dl
    <Directory /Library/WebServer/Documents/photos-dl>
        AddType application/octet-stream .jpg
    </Directory>

Restart Apache.

fin.

The image tree will now be available for regular browsing at <http://site/photos/> as before, but also for downloading at <http://site/photo-dl/>.

No mucking around with whitelists.

No risk of nasty path ../foo tricks.

It should Just Work.

And if it doesn't, your script wouldn't have either :-)



--
Chris Devers      [EMAIL PROTECTED]
http://devers.homeip.net:8080/blog/

np: 'Il Buono, Il Brutto, Il Cattivo - Titoli Di Testa'
     by Ennio Morricone
     from 'Le Colonne Sonore Originali Dei Film Di Sergio Leone'

Reply via email to