########################################################################### # $Id: index.html 7 2007-03-17 09:23:38Z beave $ ########################################################################### @main[] ^use[Archive.p] $TMP_PATH[^file:dirname[^file:fullpath[dummy]]] Parser 3. Archive. How To Use (sample file). # initializing class ^Archive:init[ $.SCRIPT_PATH[] ]

Archive. How To Use (sample file).

^printSendResult[]

add field

#end @main[] @printSendResult[][sArchive;tFiles;tContent] ^if($form:action eq 'send'){
$sArchive[$TMP_PATH/${form:filename}.$form:file_ext] $tFiles[^table::create{path}] # saving files ^for[i](1;$form:files){ ^if(def $form:[file$i]){ ^form:[file$i].save[binary;$TMP_PATH/$form:[file$i].name]

File $form:[file$i].name is successfully saved in $TMP_PATH.

^tFiles.append{$form:[file$i].name} } } # creating archive with uploaded wiles ^Archive:create[$sArchive;$tFiles] ^if(-f $sArchive){

Archive ${form:filename}.$form:file_ext is successfully created in $TMP_PATH.

} # if checked 'delete files' option, deleting files ^if(^form:delete.int(0)){ ^for[i](1;$form:files){ ^if(def $form:[file$i] && -f '$TMP_PATH/$form:[file$i].name'){ ^file:delete[$TMP_PATH/$form:[file$i].name]

File $form:[file$i].name is successfully deleted from $TMP_PATH.

} } } $tContent[^Archive:list[$sArchive]]

Archive content.

^if($tContent){ ^tContent.menu{ } }
Path Size Date &^; Time
$tContent.path $tContent.size $tContent.dt
} #end @sendForm[]