Forum OpenACS Q&A: Re: Photo-album - Uploading multiple pictures.

I tried Jeff's package but really didn't need the extra functionality so I just hacked the existing photo-add-2.tcl:

ns_write "[apm_header  "Photo upload"]
<h2>Uploading photos...</h2>

if { $file_extension=="zip" } {
   set exdir [ns_mktemp /tmp/XXXXXX]
   ns_log bug "Starting to unzip of $tmp_filename to $exdir..."
   catch {exec unzip $tmp_filename -d $exdir}
   ns_log bug "Finished unzipping"
   set l_files [list]
   foreach file [lsort [glob ${exdir}/*]] {
       set file_extension [string tolower [file extension $file]]
       regsub "\." $file_extension "" file_extension
       set photo_id [db_string get_next_object_id "select acs_object_id_seq.nextval from dual"]
       lappend l_files $file $file $file_extension $photo_id
} else {
   set l_files [list $tmp_filename $upload_file $file_extension $photo_id]

foreach {tmp_filename upload_file file_extension photo_id} $l_files {
ns_log bug "Starting to add file: $tmp_filename $file_extension $photo_id"
ns_write "Handling $tmp_filename (as $photo_id)...

Just insert this bit before set base_n_bytes... and remember to close the foreach loop before set page... in the bottom. Finally, comment out the ad_returnredirect.

Also, you'd need to set up application/x-zip-compressed as an AcceptableUploadMIMETypes in parameters.