--- loncom/publisher/loncfile.pm 2013/06/04 22:20:16 1.119
+++ loncom/publisher/loncfile.pm 2014/06/14 21:40:05 1.122
@@ -9,7 +9,7 @@
# and displays a page showing the results of the action.
#
#
-# $Id: loncfile.pm,v 1.119 2013/06/04 22:20:16 raeburn Exp $
+# $Id: loncfile.pm,v 1.122 2014/06/14 21:40:05 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -700,9 +700,20 @@ sub Copy1 {
my ($type,$return)=&exists($user, $domain, $newfilename);
$request->print($return);
if ($type eq 'error') {
- $request->print('
'.&mt('Cancel').'');
+ $request->print('
'.&mt('Cancel').'');
return;
}
+# Check if there is enough space.
+ my @fileinfo = stat($fn);
+ my ($dir,$fname) = ($fn =~ m{^(.+/)([^/]+)$});
+ my $filesize = $fileinfo[7];
+ $filesize = int($filesize/1000); #expressed in kb
+ my $output = &Apache::loncommon::excess_filesize_warning($user,$domain,'author',
+ $fname,$filesize,'copy');
+ if ($output) {
+ $request->print($output.'
'.&mt('Cancel').'');
+ return;
+ }
$request->print(
''