Fix a bug in tspush that pushes corrupted content to cache (#7696)

diff --git a/tools/tspush b/tools/tspush
index 36a65e2..a16f709 100755
--- a/tools/tspush
+++ b/tools/tspush
@@ -50,8 +50,8 @@
 die ("--file and --url must be given!" ) unless ( $f_name && $url) ;
 
 open (my $fh, '<', $f_name) or die $!;
+chomp (my $f_type = `file -b --mime $f_name`);
 my $uri = URI->new($url);
-my $f_type = `file -b --mime $f_name`;
 
 #
 # read the file in one go: