EPrints Technical Mailing List Archive

Message: #00931


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Fix for UploadMethod_file_change in IE8


A minor bug in IE8 with file upload. The file input element on the upload screen isn’t reset after  UploadMethod_file_change runs. Our users complained that they often then clicked upload and uploaded twice…

 

I think the problem is that .value is read-only in IE8. Microsoft say it is, for ‘security reasons’. Certainly the input.value = null, doesn’t work in IE8.

 

Anyway, a patch:

 

--- a/lib/static/_javascript_/auto/88_uploadmethod_file.js

+++ b/lib/static/_javascript_/auto/88_uploadmethod_file.js

@@ -339,6 +339,7 @@ function UploadMethod_file_change(input,component,prefix)

        $('_internal_'+prefix+'_add_format').click();

 

        input.value = null;

+       form.reset();

        form.removeAttribute( 'target' );

        form.setAttribute( 'action', orig_action );

        form.removeChild (input_component);

 

Thanks,

 

Jon