From: maniacikarus Date: Sun, 28 Oct 2007 08:34:42 +0000 (+0000) Subject: Fixed different File handling of IE7 and FF (Fullpath and Filename) X-Git-Tag: v3.0-alpha1~1208 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d2b476e82df5c768e770400f89267cfeccff0dfe;p=ipfire-3.x.git Fixed different File handling of IE7 and FF (Fullpath and Filename) git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@1016 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- diff --git a/html/cgi-bin/backup.cgi b/html/cgi-bin/backup.cgi index 0e29ace5f..c14e3f09d 100644 --- a/html/cgi-bin/backup.cgi +++ b/html/cgi-bin/backup.cgi @@ -88,14 +88,17 @@ elsif ( $cgiparams{'ACTION'} eq "restore" ) } elsif ( $cgiparams{'ACTION'} eq "restoreaddon" ) { + chomp($cgiparams{'UPLOAD'}); + # we need to fix cause IE7 gives the full path and FF only the filename + my @temp = split(/\\/,$cgiparams{'UPLOAD'}); my $upload = $a->param("UPLOAD"); - open UPLOADFILE, ">/tmp/$cgiparams{'UPLOAD'}"; + open UPLOADFILE, ">/tmp/".$temp[$#temp]; binmode $upload; while ( <$upload> ) { print UPLOADFILE; } close UPLOADFILE; - system("/usr/local/bin/backupctrl restoreaddon $cgiparams{'UPLOAD'} >/dev/null 2>&1"); + system("/usr/local/bin/backupctrl restoreaddon ".$temp[$#temp]." >/dev/null 2>&1"); } &Header::showhttpheaders(); @@ -270,8 +273,8 @@ print ""; print <
$Lang::tr{'backupwarning'}


-$Lang::tr{'backup'}
-$Lang::tr{'backupaddon'}
+$Lang::tr{'backup'}
+$Lang::tr{'backupaddon'}
END ;