ad_page_contract { @author Andrew Grumet @cvs-id: $Id: index.vuh,v 1.1 2001/04/20 20:51:12 donb Exp $ Serve up a photo. } {} foreach {type photo_id client_filename} [split [ad_conn path_info] /] {} set guessed_type [ns_guesstype $client_filename] set file_extension [string tolower [file extension $client_filename]] set full_path [pl_base_directory -read_only $photo_id]/$photo_id-$type$file_extension if [string equal $client_filename notfound] { regexp {(.*)/[^/]+} [ns_info pageroot] match server_base set this $server_base/packages/[ad_conn package_key]/www/photo switch $type { thumb { ns_returnfile 200 image/jpeg $this/unavail-thumb.jpg } default { ns_returnfile 200 image/jpeg $this/unavail-med.jpg } } ad_script_abort } if ![file exists $full_path] { ns_log Notice "photo-album-lite: file $full_path was requested but could not be found" set urlv [ad_conn urlv] ad_returnredirect /[join [lrange $urlv 0 [expr [llength $urlv] - 3]] /]/0000/notfound } else { ns_returnfile 200 $guessed_type $full_path }