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

Restricted characters in filename on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.1.1
    • Assignment
    • None
    • MOODLE_31_STABLE

      The PDF annotation system crashes if file submissions contain restricted characters on a Windows host. These restricted characters include: \ / : * ? " < > |

      The main issue we've seen here are submissions containing question marks in the file name which then breaks the "\assignfeedback_editpdf\task\convert_submissions" scheduled task with the following error: "Unknown exception related to local files (Could not copy file contents to temp file.)" This then stops the task from proceeding, thus the other uploads are not converted to PDF. When attempting to grade the submission via the front end the same error is displayed as the system tries to convert it to PDF again.

      Web stack configuration:
      Windows Server 2008 R2 64bit running IIS
      Moodle 3.1.1+ (Build: 20160804)
      PHP 5.6.1

      We have the PDF annotation system configured on Linux servers and I haven't been able to re-create this issue which reinforces my belief that it's caused by restricted characters in the file name.

      I also spotted another error which helps reinforce this:

      "unoconv: UnoException during import phase: The document 'file:///D:/moodledata/temp/core_file/conversions/1188447-58401de1733fd9.04836318/U22P3pSpecificationDesigns.docx' could not be opened."

      Obviously this filename doesn't contain a special character, however the files are being created / modified using their full name which could include the restricted characters.

      A solution to this would be to either strip the characters from the filenames before conversion or to hash the file name to avoid this problem completely, seeing as it would be impossible to get users to conform to not saving work with the characters.

      If you'd like any further information or would like me to test anything just let me know!

            Unassigned Unassigned
            cameron Cameron Banfield
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.