Completed upload of the file. This file contained references to other files. You can upload these now:
"); + $r->print("".&mt("Completed upload of the file. This file contained references to other files. You must upload the referenced files or else the uploaded file may not work properly.")."
"); + $r->print("".&mt("Please select the locations from which the referenced files are to be uploaded.")."
"); $r->print(&Apache::londocs::ask_for_embedded_content('/adm/portfolio',$state,\%allfiles,\%codebase, {'error_on_invalid_names' => 1, 'ignore_remote_references' => 1,})); @@ -1844,11 +1846,16 @@ sub upload_embedded { my ($r,$url,$group)=@_; for (my $i=0; $i<$env{'form.number_embedded_items'}; $i++) { next if (!exists($env{'form.embedded_item_'.$i.'.filename'})); - + my $orig_uploaded_filename = + $env{'form.embedded_item_'.$i.'.filename'}; + $env{'form.embedded_orig_'.$i} = &unescape($env{'form.embedded_orig_'.$i}); my ($path,$fname) = ($env{'form.embedded_orig_'.$i} =~ m{(.*/)([^/]*)}); + # no path, whole string is fname + if (!$fname) { $fname = $env{'form.embedded_orig_'.$i} }; + $path = $env{'form.currentpath'}.$path; $fname = &Apache::lonnet::clean_filename($fname); @@ -1870,8 +1877,8 @@ sub upload_embedded { &Apache::lonnet::userfileupload('embedded_item_'.$i,'', $port_path.$path); if ($result !~ m|^/uploaded/|) { - $r->print(''.'An error occured ('.$result. - ') while trying to upload '.&display_file($path,$fname).' Uploaded ".
@@ -1953,7 +1960,7 @@ sub createdir {
my $result=&Apache::lonnet::mkdiruserfile($uname,$udom,
$port_path.$env{'form.currentpath'}.$newdir);
if ($result ne 'ok') {
- $r->print(''.'An error occured ('.$result.
+ $r->print(''.'An error occurred ('.$result.
') while trying to create a new directory '.&display_file().'
');
}
}