--- loncom/lonnet/perl/lonuploadrep.pm 2004/03/31 16:12:08 1.1 +++ loncom/lonnet/perl/lonuploadrep.pm 2005/04/07 06:56:24 1.7 @@ -28,12 +28,15 @@ package Apache::lonuploadrep; use strict; use Apache::Constants qw(:common :http); -use Apache::lonnet(); +use Apache::lonnet; use CGI::Cookie(); sub handler { my $r = shift; if ($r->uri =~m|^/*uploaded/(\w+)/(\w+)/(.+)$|) { + my $chome=&Apache::lonnet::homeserver($2,$1); + my @ids=&Apache::lonnet::current_machine_ids(); + foreach my $id (@ids) { if ($id eq $chome) { return OK; } } my $filename = $Apache::lonnet::perlvar{'lonDocRoot'}.'/userfiles/'.$1.'/'.$2.'/'.$3; my ($info, $rtncode); if (-f $filename) { @@ -48,7 +51,7 @@ sub handler { } } } - my $response=&Apache::lonnet::getfile($r->uri,'uploadrep'); + my $response=&Apache::lonnet::repcopy_userfile($r->uri); if ($response eq 'ok') { $r->filename($filename); return OK;