+ my $prepend_userspath;
+
+ if (!$self->{tmpfile}) {
+ $self->{tmpfile} = "${fileid}.$self->{IN}";
+ $prepend_userspath = 1;
+ }
+
+ $prepend_userspath = 1 if substr($self->{tmpfile}, 0, length $userspath) eq $userspath;
+
+ $self->{tmpfile} =~ s|.*/||;
+ $self->{tmpfile} =~ s/[^a-zA-Z0-9\._\ \-]//g;
+ $self->{tmpfile} = "$userspath/$self->{tmpfile}" if $prepend_userspath;
+