Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-27169

File Picker will not upload files using IE9

    Details

    • Database:
      MySQL, Microsoft SQL
    • Testing Instructions:
      Hide

      1. Install Moodle and use IE9
      2. Create Student Account in Course
      3. Create Assignment in Course
      4. Login as Student
      5. Attempt to Upload a file to Assignment in Course
      6. Error happens during upload using File Picker

      Show
      1. Install Moodle and use IE9 2. Create Student Account in Course 3. Create Assignment in Course 4. Login as Student 5. Attempt to Upload a file to Assignment in Course 6. Error happens during upload using File Picker
    • Workaround:
      Hide

      Install another browser...

      Show
      Install another browser...
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-27169_master

      Description

      When uploading a file using IE8/IE9 using File Picker - message is returned error file not specified

      When using Firefox 4 or Chrome there is no problem.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            danmarsden Dan Marsden added a comment -

            are you using the latest version of 2.0Stable code? - there are a range of issues that have been fixed that could have been the cause - MDL-25895 MDL-24781 etc

            Show
            danmarsden Dan Marsden added a comment - are you using the latest version of 2.0Stable code? - there are a range of issues that have been fixed that could have been the cause - MDL-25895 MDL-24781 etc
            Hide
            kylem Kyle Margenau added a comment -

            I am having the same issue. I am currently running 2.0.2 (Build: 20110221). No issue with Firefox 4 or Chrome.

            Show
            kylem Kyle Margenau added a comment - I am having the same issue. I am currently running 2.0.2 (Build: 20110221). No issue with Firefox 4 or Chrome.
            Hide
            langstone jamie hibbard added a comment -

            I have the same problem. I am now running IIS7.5 but the problem also happens on Apache 2.2

            Show
            langstone jamie hibbard added a comment - I have the same problem. I am now running IIS7.5 but the problem also happens on Apache 2.2
            Hide
            jgcracknell James Cracknell added a comment -

            Hi

            Have the latest code - yes there still is a problem.

            Show
            jgcracknell James Cracknell added a comment - Hi Have the latest code - yes there still is a problem.
            Hide
            tsala Helen Foster added a comment -

            Thanks everyone for your feedback. The problem has also been reported as affecting moodle.org (see linked issue). I hope it can be fixed soon.

            Show
            tsala Helen Foster added a comment - Thanks everyone for your feedback. The problem has also been reported as affecting moodle.org (see linked issue). I hope it can be fixed soon.
            Hide
            scudelari Rafael S Macedo added a comment -

            Hello everyone.
            I am experiencing the same issue. Is there a workaround to for the problem, or at least some expected fix date?
            Thanks a lot!

            Show
            scudelari Rafael S Macedo added a comment - Hello everyone. I am experiencing the same issue. Is there a workaround to for the problem, or at least some expected fix date? Thanks a lot!
            Hide
            leebrent Brent Lee added a comment -

            Folks,

            This is an issue for our user base. We need a solution for this one as soon as we can get it.

            --Brent.

            Show
            leebrent Brent Lee added a comment - Folks, This is an issue for our user base. We need a solution for this one as soon as we can get it. --Brent.
            Hide
            matsimon Mat Simon added a comment - - edited

            A collegue who is more frequently using IE reported that you can at least temporarily work
            around by switching to compatibility mode in IE9 (reported on Windows 7 x86_64).
            No hickups with IE8 and earlier on Windows Vista and 7.

            Our setup is Scientific Linux 5 x86_64 (RHEL5), Apache 2.2.3, PostgreSQL 8.4.7,
            PHP is 5.3.6 with APC 3.1.9 (both from rpms.famillecollet.com).
            Yet running Moodle 2.0.3+ (Build: 20110602)

            So it seems to be pretty independent from the server side when comparing with earlier reporters.

            Show
            matsimon Mat Simon added a comment - - edited A collegue who is more frequently using IE reported that you can at least temporarily work around by switching to compatibility mode in IE9 (reported on Windows 7 x86_64). No hickups with IE8 and earlier on Windows Vista and 7. Our setup is Scientific Linux 5 x86_64 (RHEL5), Apache 2.2.3, PostgreSQL 8.4.7, PHP is 5.3.6 with APC 3.1.9 (both from rpms.famillecollet.com). Yet running Moodle 2.0.3+ (Build: 20110602) So it seems to be pretty independent from the server side when comparing with earlier reporters.
            Hide
            jaseeey Jason Ilicic added a comment -

            I've read around a fair bit and many sites are saying IE9 does not support the File API in HTML5. I suppose when you set it in compatibility mode, it sets it back to the old HTML4 mode.

            Furthermore, I've noticed that it does not even set the $_FILES variable in the backend. It does set $_REQUEST, but $_REQUEST does not contain enough data to copy it to $_FILES. It does not contain the temporary file path or name, nor the file type - how do you find it exactly? Something that has puzzled me.

            The best solution I could think of is to force IE8 mode through the themes.

            Inside the <head> tags, make sure the first element is '<meta http-equiv="X-UA-Compatible" content="IE=8" />' and make sure you purge all caches.

            Show
            jaseeey Jason Ilicic added a comment - I've read around a fair bit and many sites are saying IE9 does not support the File API in HTML5. I suppose when you set it in compatibility mode, it sets it back to the old HTML4 mode. Furthermore, I've noticed that it does not even set the $_FILES variable in the backend. It does set $_REQUEST, but $_REQUEST does not contain enough data to copy it to $_FILES. It does not contain the temporary file path or name, nor the file type - how do you find it exactly? Something that has puzzled me. The best solution I could think of is to force IE8 mode through the themes. Inside the <head> tags, make sure the first element is '<meta http-equiv="X-UA-Compatible" content="IE=8" />' and make sure you purge all caches.
            Hide
            mblake Michael Blake added a comment -

            This issue is reported to cause problems for a MP client. Please give this issue priority.

            Show
            mblake Michael Blake added a comment - This issue is reported to cause problems for a MP client. Please give this issue priority.
            Hide
            drex Mark Drechsler added a comment -

            Serious issue for many clients who are deploying 2.0 at the moment for me (which is how Jason found his work around) - a proper fix would be greatly appreciated.

            Show
            drex Mark Drechsler added a comment - Serious issue for many clients who are deploying 2.0 at the moment for me (which is how Jason found his work around) - a proper fix would be greatly appreciated.
            Hide
            rnicoll J Ross Nicoll added a comment -

            Jason,

            The HTML 5 File API refers to client-side file access (for example, it can allow drag and drop file uploads), but isn't the problem here (or it would not work in IE7/8 either).

            Forcing IE 8 compatibility mode sounds promising, will try that, thanks!

            Show
            rnicoll J Ross Nicoll added a comment - Jason, The HTML 5 File API refers to client-side file access (for example, it can allow drag and drop file uploads), but isn't the problem here (or it would not work in IE7/8 either). Forcing IE 8 compatibility mode sounds promising, will try that, thanks!
            Hide
            jgcracknell James Cracknell added a comment -

            Forcing IE8 compatibility mode is just a work-around IMHO. It is not a proper fix. Even if this takes a little longer getting Moodle to use the facilities thanks to HTML5 is the real goal.

            One of the annoying things about this tracker is you've got no comments from people saying "it's with me" or "working on it - could do with some help". Like previous issues I've reported you just hope. Then too I got a fix but nothing to say it had been picked up in the latest 2.0.3 downloads.

            Come on folks - this is a serious bug on a released version that has been around for many weeks now on a very popular browser. Is this going to be sorted for 2.1?

            Show
            jgcracknell James Cracknell added a comment - Forcing IE8 compatibility mode is just a work-around IMHO. It is not a proper fix. Even if this takes a little longer getting Moodle to use the facilities thanks to HTML5 is the real goal. One of the annoying things about this tracker is you've got no comments from people saying "it's with me" or "working on it - could do with some help". Like previous issues I've reported you just hope. Then too I got a fix but nothing to say it had been picked up in the latest 2.0.3 downloads. Come on folks - this is a serious bug on a released version that has been around for many weeks now on a very popular browser. Is this going to be sorted for 2.1?
            Hide
            rnicoll J Ross Nicoll added a comment -

            Possible patch; added encoding type to upload form to ensure submitted data is in the correct format.

            Show
            rnicoll J Ross Nicoll added a comment - Possible patch; added encoding type to upload form to ensure submitted data is in the correct format.
            Hide
            rnicoll J Ross Nicoll added a comment -

            Can people try the patch I've just uploaded; it just changes one line in repository/filepicker.js (watch out, the patch may create a new file you'll need to rename over the old filepicker.js) to add the encoding type for the form. You'll need to clear your cache in IE before testing, as IE seems to fairly persistently cache Javascript.

            Show
            rnicoll J Ross Nicoll added a comment - Can people try the patch I've just uploaded; it just changes one line in repository/filepicker.js (watch out, the patch may create a new file you'll need to rename over the old filepicker.js) to add the encoding type for the form. You'll need to clear your cache in IE before testing, as IE seems to fairly persistently cache Javascript.
            Hide
            langstone jamie hibbard added a comment -

            Brilliant!!!!

            ading

            enctype="multipart/form-data"
            to the form at line 1125 works a treat!!

            Thank you so much!!

            Remember to purge you caches

            Thanks Again

            Show
            langstone jamie hibbard added a comment - Brilliant!!!! ading enctype="multipart/form-data" to the form at line 1125 works a treat!! Thank you so much!! Remember to purge you caches Thanks Again
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Ho I'm getting on this... in the mean time can people following this try this:

            1) disable javascript in IE8/9.
            2) try uploading one file using the non-js interface
            3) does it work for you?

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Ho I'm getting on this... in the mean time can people following this try this: 1) disable javascript in IE8/9. 2) try uploading one file using the non-js interface 3) does it work for you? Ciao
            Hide
            quen Sam Marshall added a comment -

            I did the following test using IE8 with JavaScript turned ON:

            1. Go to a moodle.org forum in Using Moodle and click to start a new discussion. Example URL: http://moodle.org/mod/forum/post.php?forum=34

            2. Wait for it to load.

            3. Wait some more. (IE8 is slow...)

            4. Under 'Attachment', click the Add button.

            5. Select 'Upload'. Browse to a file and click Upload.

            When I did this, it worked correctly; the file picker dialog disappears and the file is added to the list of attachments. I can also then delete it using the JavaScript control.

            I repeated the test with Javascript OFF and it also worked (though that interface is pretty bad - in IE it does not fit into the box, you get scrollbars and it's horrible).

            Show
            quen Sam Marshall added a comment - I did the following test using IE8 with JavaScript turned ON: 1. Go to a moodle.org forum in Using Moodle and click to start a new discussion. Example URL: http://moodle.org/mod/forum/post.php?forum=34 2. Wait for it to load. 3. Wait some more. (IE8 is slow...) 4. Under 'Attachment', click the Add button. 5. Select 'Upload'. Browse to a file and click Upload. When I did this, it worked correctly; the file picker dialog disappears and the file is added to the list of attachments. I can also then delete it using the JavaScript control. I repeated the test with Javascript OFF and it also worked (though that interface is pretty bad - in IE it does not fit into the box, you get scrollbars and it's horrible).
            Hide
            leebrent Brent Lee added a comment -

            Eloy: I can confirm that this works when I disable Javascript in IE9.

            Show
            leebrent Brent Lee added a comment - Eloy: I can confirm that this works when I disable Javascript in IE9.
            Hide
            jferring JM Ferring added a comment - - edited

            Hello: I have an xampp installation with multiple moodle versions on Windows 7 64bit.

            1) when using IE9 + Moodle 2.1beta (Build: 20110617) file picker does not work (file not specified error) with javascript but works when javascript is deactivated
            2) when using IE9 + Moodle 2.0.3+ (Build: 20110518) file picker does not work (file not specified error) with javascript but works when javascript is deactivated

            Worked fine with IE8 (until I upgrated ) and still works fine with Firefox 4.

            Show
            jferring JM Ferring added a comment - - edited Hello: I have an xampp installation with multiple moodle versions on Windows 7 64bit. 1) when using IE9 + Moodle 2.1beta (Build: 20110617) file picker does not work (file not specified error) with javascript but works when javascript is deactivated 2) when using IE9 + Moodle 2.0.3+ (Build: 20110518) file picker does not work (file not specified error) with javascript but works when javascript is deactivated Worked fine with IE8 (until I upgrated ) and still works fine with Firefox 4.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Thanks Sam, Brent & JM. I think that's enough to assume the missing enctype="multipart/form-data" is the cause for problems under IE9.

            I've cooked this 2 branches (tons of thanks, J Ross Nicoll):

            And I'm going to send this for integration right now, so hopefully will land upstream along this week.

            In the mean time it would be great if people having problems with the js version under IE9 could:

            1) Apply the modification above (it's one 1-line change)
            2) Purge caches
            3) Retest the js version with IE9
            4) Feedback here

            TIA and ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Thanks Sam, Brent & JM. I think that's enough to assume the missing enctype="multipart/form-data" is the cause for problems under IE9. I've cooked this 2 branches (tons of thanks, J Ross Nicoll): for 2.1beta: https://github.com/stronk7/moodle/compare/master...MDL-27169_master for 2.0.3+: https://github.com/stronk7/moodle/compare/MOODLE_20_STABLE...MDL-27169_m20 And I'm going to send this for integration right now, so hopefully will land upstream along this week. In the mean time it would be great if people having problems with the js version under IE9 could: 1) Apply the modification above (it's one 1-line change) 2) Purge caches 3) Retest the js version with IE9 4) Feedback here TIA and ciao
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            (submitted for integration)

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - (submitted for integration)
            Hide
            jferring JM Ferring added a comment -

            Hi,
            Congratulations, your patch works on both installations

            Moodle 2.1beta (Build: 20110617) + Moodle 2.0.3+ (Build: 20110518)

            Thanks a lot.

            Show
            jferring JM Ferring added a comment - Hi, Congratulations, your patch works on both installations Moodle 2.1beta (Build: 20110617) + Moodle 2.0.3+ (Build: 20110518) Thanks a lot.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            All yours Sam. I think this it the last we pass this week, seems important enough to add it IMO.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - All yours Sam. I think this it the last we pass this week, seems important enough to add it IMO.
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Thanks guys - definitely worth having for the upcoming release and has been integrated now.
            Cheers
            Sam

            Show
            samhemelryk Sam Hemelryk added a comment - Thanks guys - definitely worth having for the upcoming release and has been integrated now. Cheers Sam
            Hide
            rwijaya Rossiani Wijaya added a comment -

            Test passed - Both patches fixed the issue

            Show
            rwijaya Rossiani Wijaya added a comment - Test passed - Both patches fixed the issue
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            All git & cvs servers have been updated with these cool changes, so closing, many thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - All git & cvs servers have been updated with these cool changes, so closing, many thanks!
            Hide
            a.duran Armando Duran added a comment -

            Hi All,

            The two branches mentioned in this comment by Eloy: http://tracker.moodle.org/browse/MDL-27169?focusedCommentId=114039&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-114039 take me to a 404 page.

            So this is how I solved the issue, it can probably help you if you can't update Moodle as it was my case and you have a different version.

            After I read this comment by Jamie: http://tracker.moodle.org/browse/MDL-27169?focusedCommentId=113695&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-113695 I tried locating line 1125 in repository/filepciker.js only to NOT find it because I don't have the same Moodle version, so here is what I did and what I suggest you do if you are in the same situation:

            • Open repository/filepicker.js
            • Search for: str = '<form id="'+id'" method="POST">';
            • Once located, this is the line of code to modify
            • Add: enctype="multipart/form-data" to the <form> tag
            • The resulting line of code is: str = '<form id="'+id'" enctype="multipart/form-data" method="POST">';
            • Save and ... rejoice!
            Show
            a.duran Armando Duran added a comment - Hi All, The two branches mentioned in this comment by Eloy: http://tracker.moodle.org/browse/MDL-27169?focusedCommentId=114039&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-114039 take me to a 404 page. So this is how I solved the issue, it can probably help you if you can't update Moodle as it was my case and you have a different version. After I read this comment by Jamie: http://tracker.moodle.org/browse/MDL-27169?focusedCommentId=113695&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-113695 I tried locating line 1125 in repository/filepciker.js only to NOT find it because I don't have the same Moodle version, so here is what I did and what I suggest you do if you are in the same situation: Open repository/filepicker.js Search for: str = '<form id="'+id '" method="POST">'; Once located, this is the line of code to modify Add: enctype="multipart/form-data" to the <form> tag The resulting line of code is: str = '<form id="'+id '" enctype="multipart/form-data" method="POST">'; Save and ... rejoice!
            Hide
            sethanonmk John Allen added a comment - - edited

            Tried the above and was met with errors in Firefox and IE 9. It was missing the + symbol when editing filepicker.js

            You need to add a + before the = sign.

            The comment box strips the + sign out below.

            str = '<form id="'+id'" enctype="multipart/form-data" method="POST">';

            Show
            sethanonmk John Allen added a comment - - edited Tried the above and was met with errors in Firefox and IE 9. It was missing the + symbol when editing filepicker.js You need to add a + before the = sign. The comment box strips the + sign out below. str = '<form id="'+id '" enctype="multipart/form-data" method="POST">';
            Hide
            mp Mike Perri added a comment -

            This is still broken for 2.2.2+ The above patch I see was applied in the code for 2.2.2, but it will not work for IE9 or Firefox 12. Chrome has also been reported to not work.
            I can get IE9 to work with compatibility mode and also changing the security mode for active scripting to disabled. This will be a show stopper for students that have updated systems.

            Show
            mp Mike Perri added a comment - This is still broken for 2.2.2+ The above patch I see was applied in the code for 2.2.2, but it will not work for IE9 or Firefox 12. Chrome has also been reported to not work. I can get IE9 to work with compatibility mode and also changing the security mode for active scripting to disabled. This will be a show stopper for students that have updated systems.
            Hide
            gordonmc Gordon McLeod added a comment -

            Just to say this issue is back in 2.3 - I've seen 3 posts to moodle forums in past 24 hours (including my own) to say users can no longer use the file picker with IE9. The content box doesn't load to allow the user to browse for files - you just get the loading spinner. This is pretty critical - there are lots of institutions out there with IE as the default browser - not everyone has the option of switching to firefox. Forum - https://moodle.org/mod/forum/discuss.php?d=206599#p934925 Thanks, Gordon.

            Show
            gordonmc Gordon McLeod added a comment - Just to say this issue is back in 2.3 - I've seen 3 posts to moodle forums in past 24 hours (including my own) to say users can no longer use the file picker with IE9. The content box doesn't load to allow the user to browse for files - you just get the loading spinner. This is pretty critical - there are lots of institutions out there with IE as the default browser - not everyone has the option of switching to firefox. Forum - https://moodle.org/mod/forum/discuss.php?d=206599#p934925 Thanks, Gordon.
            Hide
            mkaramosly Mehdi Karamosly added a comment -

            Hi guys, I don't have access to the code but would you please join the javascript file that has the problem, or make sure you are not using document.createElement('<iframe... document.createElement has an issue with IE when you specify tags into a string.
            annother possible solution for IE9 is to upload the file using https.
            http://stackoverflow.com/questions/5344029/invalid-character-dom-exception-in-ie9
            https://www.parse.com/questions/internet-explorer-and-the-javascript-sdk

            Thanks,

            Show
            mkaramosly Mehdi Karamosly added a comment - Hi guys, I don't have access to the code but would you please join the javascript file that has the problem, or make sure you are not using document.createElement('<iframe... document.createElement has an issue with IE when you specify tags into a string. annother possible solution for IE9 is to upload the file using https. http://stackoverflow.com/questions/5344029/invalid-character-dom-exception-in-ie9 https://www.parse.com/questions/internet-explorer-and-the-javascript-sdk Thanks,

              People

              • Votes:
                39 Vote for this issue
                Watchers:
                21 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  1/Aug/11