0

I am having issue with Struts 2 file upload for Word file(.docx, .doc) in Internet Explorer. It works fine in Chrome and Firefox, but I am not sure what I am missing for IE. I am using IE9. I appreciate your advice.

<action name="saveOrUpdateUser" method="saveOrUpdate"
            class="com.adaptivsol.action.UsersAction">
    <interceptor-ref name="defaultStack">
        <param name="fileUpload.maximumSize">104857600</param>
        <param name="allowedTypes">
                text/plain,                 
                application/word,
                application/msword,
                application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
                application/vnd.openxmlformats-officedocument.wordprocessingml.document
        </param>
        <param name="allowedExtensions">doc,docx,txt</param>
    </interceptor-ref>
    <result name="success">./pages/login/register.jsp</result>
    <result name="input">./pages/login/register.jsp</result>
    <result name="error">./pages/login/register.jsp</result>
</action>
Aleksandr M
  • 24,264
  • 12
  • 69
  • 143
  • 1
    What is the issue you're having with IE9? Please update the question with a description of how it is not working. Thanks! – JoelC Apr 24 '15 at 15:50
  • It is a File Upload function. The file goes through using Fire fox and Chrome. On Internet Explorer the Interceptor blocks the submit action. I have tried several version of interceptors, even removed it completely, all of them works on Chrome, but no luck on IE9. – Ryan Ehsani Apr 24 '15 at 16:03

1 Answers1

0

Your parameters are wrong, the fileUpload. prefix is missing in two of them, they need to be:

<param name="fileUpload.allowedTypes">
    text/plain,                 
    application/word,
    application/msword,
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
    application/vnd.openxmlformats-officedocument.wordprocessingml.document
</param>
<param name="fileUpload.allowedExtensions">doc,docx,txt</param>

By the way, set devMode to true in struts.xml, and post here the logs where the file upload stop working. We need to see an error, a warning, a message, something to understand what's wrong.

Also in your JSP add actionerrors, actionmessages and fielderrors printing capabilities, and report here the message you get.

Community
  • 1
  • 1
Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
  • Thanks for your support. I have changed the . Again din' work even in Chrome. I removed Interceptor it works perfect in Chrome, in IE it never hit the server side codes. That's why it never populate any error. Just the page is uploading again. – Ryan Ehsani Apr 24 '15 at 17:14