Moodle
  1. Moodle
  2. MDL-31925

File Attachments Downloaded From Assignment Submissions Corrupt

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.2, 2.2.1
    • Fix Version/s: None
    • Component/s: Assignment (2.2)
    • Labels:
      None
    • Testing Instructions:
      Hide

      Create an Online Assignment in Moodle 2.1. Using the html editor upload a video file, and insert it into the submissions text area. Save the activity and view the assignment. The video will fail to play, because the file is corrupt.

      Show
      Create an Online Assignment in Moodle 2.1. Using the html editor upload a video file, and insert it into the submissions text area. Save the activity and view the assignment. The video will fail to play, because the file is corrupt.
    • Workaround:
      Hide

      Currently I have created my own cut down version of pluginfile.php that I call from my own assignment type. I don't like it because it is not as secure, but for now I have no alternative.

      Show
      Currently I have created my own cut down version of pluginfile.php that I call from my own assignment type. I don't like it because it is not as secure, but for now I have no alternative.
    • Affected Branches:
      MOODLE_22_STABLE
    • Rank:
      38575

      Description

      When you upload a non text file into an assignment, and later download that file, the file has two new line characters added at the beginning of the byte stream corrupting the file. I have done a lot of testing, because I thought the bug was mine. The file is uploaded correctly and somewhere after pluginfile.php branches processing depending on the activity type, and before the send_stored_file function is called the new line characters are appended. I could not find the location myself, though I tried.

        Issue Links

          Activity

          Justin Hunt created issue -
          Michael de Raadt made changes -
          Field Original Value New Value
          Link This issue has a non-specific relationship to MDL-27125 [ MDL-27125 ]
          Hide
          Michael de Raadt added a comment -

          Hi, Justin.

          I tried to replicate this by adding a few media files to an online assignment submission. The files seemed to be OK after the submission was saved, but perhaps the formats were not affected by the corruption you mention.

          What sorts of files were you attaching to submissions? Do you have a small example we could uses?

          Are there more specific steps we could follow to replicate this problem?

          Show
          Michael de Raadt added a comment - Hi, Justin. I tried to replicate this by adding a few media files to an online assignment submission. The files seemed to be OK after the submission was saved, but perhaps the formats were not affected by the corruption you mention. What sorts of files were you attaching to submissions? Do you have a small example we could uses? Are there more specific steps we could follow to replicate this problem?
          Hide
          Justin Hunt added a comment -

          Thanks for looking at it Michael. I just tried now over on http://demo.moodle.org . In the Exchange Samples course as Admin, I created an Online assignment called "An upload test."
          (If you get there today, it'll still be there.)

          I then logged in as a student, using Chrome, and once TinyMCE had loaded, I selected "Moodle Media." from the TinyMCE menu. Then I uploaded a .flv file using the "Upload a File" repository.

          The file was uploaded correctly, or so it seemed. Flowplayer displays, but the file does not playback.

          I will try to attach the file that I tested the upload with.

          Show
          Justin Hunt added a comment - Thanks for looking at it Michael. I just tried now over on http://demo.moodle.org . In the Exchange Samples course as Admin, I created an Online assignment called "An upload test." (If you get there today, it'll still be there.) I then logged in as a student, using Chrome, and once TinyMCE had loaded, I selected "Moodle Media." from the TinyMCE menu. Then I uploaded a .flv file using the "Upload a File" repository. The file was uploaded correctly, or so it seemed. Flowplayer displays, but the file does not playback. I will try to attach the file that I tested the upload with.
          Hide
          Justin Hunt added a comment -

          Couldn't attach. Here is a link to the test flv file
          http://m20.poodll.com/22temp/22/justin_333.flv

          Show
          Justin Hunt added a comment - Couldn't attach. Here is a link to the test flv file http://m20.poodll.com/22temp/22/justin_333.flv
          Hide
          Justin Hunt added a comment - - edited

          Actually I just retested on the demo site and on my own Moodle 2.2.2 and in fact the problem no longer exists in the latest version of Moodle. So thats great.

          Show
          Justin Hunt added a comment - - edited Actually I just retested on the demo site and on my own Moodle 2.2.2 and in fact the problem no longer exists in the latest version of Moodle. So thats great.
          Hide
          Michael de Raadt added a comment -

          Hi, Justin.

          demo.moodle.org resets hourly, so I'll try this again with your file.

          Show
          Michael de Raadt added a comment - Hi, Justin. demo.moodle.org resets hourly, so I'll try this again with your file.
          Hide
          Michael de Raadt added a comment -

          Hi, Justin.

          Three thousand, three hundred and thirty-three.

          I tried this on demo.moodle.org. I was able to attach your file to an online submission without any problem. It played nicely for me.

          I'm going to close this issue for now, but if the problem comes up again in future, and you can reproduce it, please launch a new issue.

          Kudos on Poodll by the way.

          Show
          Michael de Raadt added a comment - Hi, Justin. Three thousand, three hundred and thirty-three. I tried this on demo.moodle.org. I was able to attach your file to an online submission without any problem. It played nicely for me. I'm going to close this issue for now, but if the problem comes up again in future, and you can reproduce it, please launch a new issue. Kudos on Poodll by the way.
          Michael de Raadt made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Cannot Reproduce [ 5 ]

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: