From 5da73ac30a52234cc126ead03cddaf5a4e131019 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 14 Aug 2008 11:56:07 +0000 Subject: customer import: add progress bar & redirect to a search of the imported customers, #3475 --- httemplate/misc/file-upload.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'httemplate/misc/file-upload.html') diff --git a/httemplate/misc/file-upload.html b/httemplate/misc/file-upload.html index 9649d3663..469274c69 100644 --- a/httemplate/misc/file-upload.html +++ b/httemplate/misc/file-upload.html @@ -2,7 +2,7 @@ % if ($error) { Error: <% $error %> % }else{ -Freeside File Upload Successful <% join(',', @filenames) %>; +File Upload Successful <% join(',', @filenames) %>; % } <% include('/elements/footer.html') %> <%init> @@ -17,7 +17,7 @@ $cgi->param('upload_fields') =~ /^([,\w]+)$/ or $error = "invalid upload_fields"; my $fields = $1; -my $dir = $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc; +my $dir = $FS::UID::cache_dir. "/cache.". $FS::UID::datasrc; foreach my $field (split /,/, $fields) { next if $error; @@ -25,7 +25,13 @@ foreach my $field (split /,/, $fields) { 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, ) -- cgit v1.2.1