<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi Claire,<br>
    <br>
    &nbsp;I add this code to EPrints:Plugin::Screen::EPrint::UploadMethod in
    method "action_add_format" after row<br>
    <blockquote><i><small>my $filepath =
          $session-&gt;query-&gt;tmpFileName( $fh );</small></i><br>
    </blockquote>
    &nbsp;This is my code:<br>
    <blockquote><small><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $size=-s $filepath;</i></small><br>
      <small><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( $session-&gt;can_call('upload_file')) {</i></small><br>
      <small><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my
@problems=$session-&gt;call('upload_file',$session,$size,$filepath,$filename);</i></small><br>
      <small><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (@problems) {</i></small><br>
      <small><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $processor-&gt;{notes}-&gt;{upload} = {};</i></small><br>
      <small><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (@problems) {</i></small><br>
      <small><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $processor-&gt;add_message( "error",$_);</i></small><br>
      <small><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</i></small><br>
      <small><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $processor-&gt;{notes}-&gt;{upload} = {};</i></small><br>
      <small><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $processor-&gt;{notes}-&gt;{epdata} = {};</i></small><br>
      <small><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0</i></small><br>
      <small><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</i></small><br>
      <small><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</i></small><br>
    </blockquote>
    Then in cfg/cfg.d you can add a configuration file like "upload.pl"
    with this content:<br>
    <blockquote><small>$c-&gt;{'upload'}={</small><br>
      <small>&nbsp; upload_limit=&gt;100*1024*1024,</small><br>
      <small>};</small><br>
      <small>$c-&gt;{'upload_file'}=sub {</small><br>
      <small>&nbsp; my ($session,$size,$filepath,$filename)=@_;</small><br>
      <small>&nbsp; my @problems=();</small><br>
      <small>&nbsp; my
        $upload_limit=$session-&gt;get_repository-&gt;get_conf('upload');</small><br>
      <small>&nbsp; $upload_limit=$upload_limit-&gt;{'upload_limit'};</small><br>
      <small>&nbsp; if ( $upload_limit &amp;&amp;&nbsp; $size &gt; $upload_limit )
        {</small><br>
      <small>&nbsp;&nbsp;&nbsp;&nbsp; push @problems,$session-&gt;html_phrase(
        "Plugin/InputForm/Component/Upload:upload_failed",cause=&gt;$session-&gt;make_text("file
        size $size bytes &gt; $upload_limit bytes") )</small><br>
      <small>&nbsp; }</small><br>
    </blockquote>
    <br>
    You can change your limit by upload_limit in upload.pl (in the
    example the limit is 100MB)<br>
    So in upload.pl we can insert code for antivirus check also.<br>
    <br>
    Regards,<br>
    &nbsp; Enio<br>
    <br>
    <br>
    Il 05/04/2012 13:40, <a class="moz-txt-link-abbreviated" href="mailto:C.Eskriett@brighton.ac.uk">C.Eskriett@brighton.ac.uk</a> ha scritto:
    <blockquote
cite="mid:EMEW3|e5e2455730b8c4035a337db0e32eb2f8o34Cf514eprints-tech-bounces|ecs.soton.ac.uk|3273D9A44CAA934F9958F085FFD6F7F794624096@ALUDRA.university.brighton.ac.uk"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi<o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">I&#8217;ve been trying to find out (in response
          to a question from the people implementing our new CRIS)if
          eprints has a maximum file size for document upload. My
          googling has let me down on this. I can&#8217;t see where this might
          be configurable within cfg.d files, but maybe it is elsewhere
          on the server? Can anyone enlighten me on where to look? I
          imagine we either have the default value or no value, but need
          to confirm what that defulat value might be.<o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Here&#8217;s hoping! <o:p></o:p></p>
        <p class="MsoNormal">Many thanks<o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Claire<o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal"><b><span style="font-size: 10pt;">Claire
              Eskriett, Systems Librarian<o:p></o:p></span></b></p>
        <p class="MsoNormal"><b><span style="font-size: 10pt;">(Days of
              work are Mon, Tues, Thurs &amp; Fri)<o:p></o:p></span></b></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">Information
            Services<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">Cockcroft
            Building<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">University
            of Brighton<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">Lewes Road<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">Brighton BN2
            4GJ<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">T: 01273
            642766<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 10pt;">E:
            <a class="moz-txt-link-abbreviated" href="mailto:C.Eskriett@brighton.ac.uk">C.Eskriett@brighton.ac.uk</a><o:p></o:p></span></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
      </div>
      <br clear="both">
      ___________________________________________________________<br>
      This email has been scanned by MessageLabs' Email Security<br>
      System on behalf of the University of Brighton.<br>
      For more information see <a class="moz-txt-link-freetext" href="http://www.brighton.ac.uk/is/spam/">http://www.brighton.ac.uk/is/spam/</a><br>
      ___________________________________________________________<br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
*** Options: <a class="moz-txt-link-freetext" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a class="moz-txt-link-freetext" href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a>
*** EPrints community wiki: <a class="moz-txt-link-freetext" href="http://wiki.eprints.org/">http://wiki.eprints.org/</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
____________________________________
 Ing. Enio Carboni
 CESIA - Centro Servizi Informatici di Ateneo 
 Alma Mater Studiorum - Universit&agrave; di Bologna
 V.le Filopanti, 3 - 40126 Bologna - Italy
 <a class="moz-txt-link-freetext" href="http://www.unibo.it">http://www.unibo.it</a>
 <a class="moz-txt-link-freetext" href="http://www.biblioteche.unibo.it">http://www.biblioteche.unibo.it</a>
 <a class="moz-txt-link-freetext" href="mailto:enio.carboni@unibo.it">mailto:enio.carboni@unibo.it</a>
____________________________________</pre>
    <br>
  </body>
</html>