diff options
author | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
commit | c82d349f864e6bd9f96fd1156903bc1f7193a203 (patch) | |
tree | e117a87533656110b6acd56fc0ca64289892a9f5 /httemplate/misc/file-upload.html | |
parent | 74e058c8a010ef6feb539248a550d0bb169c1e94 (diff) |
This commit was manufactured by cvs2svn to create tag 'TORRUS_1_0_9'.TORRUS_1_0_9
Diffstat (limited to 'httemplate/misc/file-upload.html')
-rw-r--r-- | httemplate/misc/file-upload.html | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/httemplate/misc/file-upload.html b/httemplate/misc/file-upload.html deleted file mode 100644 index 469274c69..000000000 --- a/httemplate/misc/file-upload.html +++ /dev/null @@ -1,53 +0,0 @@ -<% include('/elements/header-minimal.html', 'File Upload') %> -% if ($error) { -Error: <% $error %> -% }else{ -File Upload Successful <% join(',', @filenames) %>; -% } -<% include('/elements/footer.html') %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); #? - -my @filenames = (); -my $error = ''; # could be extended to the access control - -$cgi->param('upload_fields') =~ /^([,\w]+)$/ - or $error = "invalid upload_fields"; -my $fields = $1; - -my $dir = $FS::UID::cache_dir. "/cache.". $FS::UID::datasrc; - -foreach my $field (split /,/, $fields) { - next if $error; - - my $fh = $cgi->upload($field) - or $error = "No valid file was provided."; - - my $suffix = ''; - if ( $cgi->param($field) =~ /(\.\w+)$/i ) { - $suffix = lc($1); - } - - my $sh = new File::Temp( TEMPLATE => 'upload.XXXXXXXX', - SUFFIX => $suffix, - DIR => $dir, - UNLINK => 0, - ) - or $error ||= "can't open temporary file to store upload: $!\n"; - - unless ($error) { - while(<$fh>) { - print $sh $_; - } - $sh->filename =~ m!.*/([.\w]+)$!; - push @filenames, "$field:$1"; - close $sh - } - -} - -$error = "No files" unless scalar(@filenames); - -</%init> |