Fix to use universal upload tracking directory

https://forum.virtualmin.com/t/upload-progress-bar-not-showing/136374?u=ilia
This commit is contained in:
Ilia Ross
2026-01-24 00:37:52 +02:00
parent 202a1b0b78
commit e8e804ddca
2 changed files with 3 additions and 20 deletions

View File

@@ -28,13 +28,7 @@ print "</table></center>\n";
print "</form>\n";
# Find the location of the user's upload progress file
if ($in{'uid'}) {
@uinfo = getpwuid($in{'uid'});
$upfile = "$uinfo[7]/.tmp/upload.$id";
}
else {
$upfile = &tempname_dir()."/upload.$id";
}
my $upfile = &tempname_dir_sys()."/upload.$id";
# Read the tracker file in a loop until done, or until 1 minute has passed
# with no progress

View File

@@ -1063,19 +1063,8 @@ my ($size, $totalsize, $filename, $id) = @_;
return if ($gconfig{'no_upload_tracker'});
return if (!$id);
# Create the upload tracking directory - if running as non-root, this has to
# be under the user's home
my $vardir;
if ($<) {
my @uinfo = @remote_user_info ? @remote_user_info : getpwuid($<);
$vardir = "$uinfo[7]/.tmp";
}
else {
$vardir = &tempname_dir();
}
if (!-d $vardir) {
&make_dir($vardir, 0755);
}
# Universal upload tracking directory
my $vardir = &tempname_dir_sys();
# Remove any upload.* files more than 1 hour old
if (!$main::read_parse_mime_callback_flushed) {