[LON-CAPA-dev] File replication on library server

Mark Lucas lon-capa-dev@mail.lon-capa.org
Tue, 16 Oct 2007 06:59:38 -0400


I have a small file download routine that pulls together a zip file of
submissions. This runs fine on an access server, but I tried it this
morning on my library server and it does not work. It seems the files do
not end up in the same place as they do on the access server.

The following chunk of code pulls together uploaded files from students
into one directory. I'm figuring the issue is that in this case, access
to files on the library server does not behave like access on the access
servers. Can someone illuminate me? 8)


# Get the data
    foreach my $student (@$students) {
        my $domain = $student->{'domain'};
        my $username = $student->{'username'};
        my %history = Apache::lonnet::restore($symb,$courseid,$domain,
        my $uploadurl=$history{'resource.0.upload.uploadedurl'};
        if ($uploadurl) {
           my $filelocation = &Apache::lonnet::filelocation($uploadurl);

           if (!-e $filelocation)

           my $file1 = $filelocation;
           $file1 =~ s|uploaded|home/httpd/html/userfiles|;
           my @tmp = split(/\./,$file1);
           my $filetype = pop(@tmp);
           $filetype =~ s|/||g;
           my $file2 =
        } else {
           $html .= "NO FILE for $username<br/>\n";