Hi Chris,

I'm not at home (where the server is) so I'll give that a try, too. The drawback on this method would be that I would only be able to use it on a server that I had access to the Apache config file. This works well at home, but not so well with a paid outside hosting service. But I'm gonna try it! I'll let you know how it goes.

Thanks,

Mark


On Aug 24, 2004, at 4:34 PM, Chris Devers wrote:

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