<%flags> inherit => '/init.comp' %flags> <%perl> my $BaseUrl = $r->dir_config('BaseUrl'); my $tmpDir = $r->dir_config('TmpDir')."/put_firmato-$$-".rand(999999); $Session{Put_firmato_tmpDir} = $tmpDir; mkdir $tmpDir || die "Errore creazione dir $tmpDir: $!\n"; my $field_file_firmato = $m->scomp('SELF:Field_filename'); my $file_firmato = $ARGS{$field_file_firmato}; use MIME::Base64; use MIME::Parser; use Archive::Zip; use Digest::SHA1; use File::Remove q(remove); use Date::Parse; my $dbh = $Session{Dbh}; #Firme da cercare nel file firmato my $Query_firme = $m->scomp('SELF:Query_firme'); my $sth_firme = $Query_firme ? $dbh->prepare($Query_firme) : undef; # Per verificare se nel DB e' presente la hash calcolata my $sth_archivio = $dbh->prepare($m->scomp('SELF:Query_archivio')); # Per aggiornare l'archivio caricando il file firmato my $sth_update_archivio = $dbh->prepare($m->scomp('SELF:Query_update_archivio')); sub fine(){ remove(\1, $Session{Put_firmato_tmpDir}); $m->out(q{