--- loncom/publisher/lonupload.pm 2013/07/02 19:04:49 1.63 +++ loncom/publisher/lonupload.pm 2013/12/04 17:29:44 1.66 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to upload files into construction space # -# $Id: lonupload.pm,v 1.63 2013/07/02 19:04:49 raeburn Exp $ +# $Id: lonupload.pm,v 1.66 2013/12/04 17:29:44 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -201,19 +201,13 @@ sub phaseone { return; } $filesize = int($filesize/1000); #expressed in kb - my $disk_quota = &Apache::loncommon::get_user_quota($uname,$udom,'author'); #expressed in Mb - $disk_quota = int($disk_quota * 1000); - my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; - my $current_disk_usage = &Apache::lonnet::diskusage($udom,$uname,"$londocroot/priv/$udom/$uname"); - if (($current_disk_usage + $filesize) > $disk_quota){ - $r->print(''. - &mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.',''.$env{'form.upfile.filename'}.'',$filesize).''. - '
'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',$disk_quota,$current_disk_usage). - '

'. - &earlyout($fn,$uname,$udom)); + my $output = &Apache::loncommon::excess_filesize_warning($uname,$udom,'author', + $env{'form.upfile.filename'},$filesize,'upload'); + if ($output) { + $r->print($output.&earlyout($fn,$uname,$udom)); return; } - + # Split part that I can change from the part that I cannot change my ($fn1,$fn2)=($fn=~/^(\/priv\/[^\/]+\/[^\/]+\/)(.*)$/); # Display additional options for upload @@ -399,7 +393,7 @@ sub check_extension { if ($pathchg) { if ($mode eq 'testbank') { $returnflag = 'embedded'; - $result .= '

'.&mt('Or [_1]continue[_2] the testbank import without modifying the references(s).','','').'

'; + $result .= '

'.&mt('Or [_1]continue[_2] the testbank import without modifying the reference(s).','','').'

'; } } }