<p>Hi,</p>
<p>Is this on the latest EPrints? I thought messages could be displayed in an ajax context now (perhaps something wrong with the upload component...).</p>
<p>If you're interested, you may want to look into putting your "scan" hook into:</p>
<p>- a trigger (when a document object is committed to the DB, see EP_TRIGGER_AFTER_COMMIT for example)</p>
<p>- when the above trigger's called you may create an Event which will perform the scan (this way the uploader doesn't hang on the scan) and take action if necessary.</p>
<p>Voila, I'll look into the other problems tomorrow,</p>
<p>Seb.</p>
<p> </p>
<p>On Thu, 21 Jun 2012 18:17:27 +0000, <rchilliard@mun.ca> wrote:</p>
<blockquote style="padding-left: 5px; border-left: 2px solid #1010ff; margin-left: 5px; width: 100%;"><!-- html ignored --><!-- head ignored --><!-- meta not allowed --><!-- style not allowed -->
<div style="direction: ltr; font-family: Tahoma; color: #000000; font-size: 10pt;">Hi All,<br /><br /> In the process of attempting to build a hook for on-demand virus scanning of uploaded files, I've been tinkering with action_add_format within UploadMethod.pm as it seems the most relevant location to hook in. In the case of a bad file, I want to toss the uploaded file and display an error message, comparable to that which would show up for a file transfer that otherwise fails: as an example, the existing "file didn't show up" handling code:<br /> <br /> --- snip ---<br /> if( !EPrints::Utils::is_set( $filename ) || !defined $fh )<br /> {<br /> $processor->{notes}->{upload} = {};<br /> $processor->add_message( "error", $self->{session}->html_phrase( "Plugin/InputForm/Component/Upload:upload_failed" ) );<br /><br /> return 0;<br /> }<br /> --- snip ---<br /><br /> In our case, this test would be replaced for an assessment of the virus scan results on the file, giving pass/fail.<br /><br /> In building this process, I think I've found a bit of a bug - the current upload configuration, using the ajax code to display the upload progress bar, seems to ignore any add_message() content from ever reaching the workflow page. No matter where in the subroutine an add_message call is placed; when it is called as a result of a file being uploaded via the form's File control, no message appears. <br /><br /> I've found this to be an issue on Firefox, IE and Chrome. Interestingly, on IE, the name of any file selected by the form control persists in the control after upload; if the "Upload" button is then clicked with the form in this state, add_message calls within action_add_format are respected, however the progress bar does not display.<br /><br /> As is, it seems the message feedback for any sort of upload trouble seems to be broken, can any others confirm?<br /><br /> Cheers,<br /> Casey<br />
<div><br />
<div style="font-family: Tahoma; font-size: 13px;"><span style="font-size: x-small;"><span style="font-family: Tahoma;"></span></span>
<hr style="width: 100%; height: 2px;" />
<span style="font-size: x-small;"><span style="font-family: Tahoma;">Casey Hilliard</span><br style="font-family: Tahoma;" /><span style="font-family: Tahoma;">PC Consultant,</span><br style="font-family: Tahoma;" /><span style="font-family: Tahoma;">Health Sciences Library / QE2 Systems,</span><br style="font-family: Tahoma;" /><span style="font-family: Tahoma;">Memorial University</span><br style="font-family: Tahoma;" /><span style="font-family: Tahoma;"><span style="font-family: Tahoma;"><br /></span></span></span></div>
</div>
</div>
<br />This electronic communication is governed by the terms and conditions at http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php</blockquote>
<p> </p>