Moodle
  1. Moodle
  2. MDL-32290

Extension and type of uploaded files

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: Files API
    • Labels:
      None
    • Environment:
      Moodle 2.2.2, russian
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      1) Choose a file with non-empty extension when you upload a file. I.e. 'file.doc'.
      2) Type a dot and the end of 'Save as' field's content. I.e. 'This is a file.'.
      3) Upload.
      The file's name will be 'This is a filedoc' and the file's type will be unknown (icon with a questyion symbol).

      Show
      1) Choose a file with non-empty extension when you upload a file. I.e. 'file.doc'. 2) Type a dot and the end of 'Save as' field's content. I.e. 'This is a file.'. 3) Upload. The file's name will be 'This is a filedoc' and the file's type will be unknown (icon with a questyion symbol).
    • Affected Branches:
      MOODLE_22_STABLE

      Description

      Type '.' (dot) at the end of 'Save as' field uploading files. Then the name of 'file.ext' file with 'saveas.' save-as-field will be 'saveasext' and type of the file will be UNKNOWN.

      Ok if we type dot in a filename we have to set an extension. And if nothing comes after it extension must be empty. But:
      1) What does mean 'Save as' field? Name of FILE or NAME of file? It's difficult for my project's student & teachers...
      2) If it's a file name why 'ext' (WITHOUT DOT) is added to 'saveas' text?

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Michael de Raadt added a comment -

            I believe this is a duplicate, or very similar to, MDL-29748. Could you please contribute to that issue.

            Show
            Michael de Raadt added a comment - I believe this is a duplicate, or very similar to, MDL-29748 . Could you please contribute to that issue.
            Hide
            Alexander Kurakin added a comment -

            No that issue is about l12n. Didn't you mistake? This is not duplicate! Open please!

            Show
            Alexander Kurakin added a comment - No that issue is about l12n. Didn't you mistake? This is not duplicate! Open please!
            Hide
            Saswat Padhi added a comment -

            This is not a duplicate.

            Show
            Saswat Padhi added a comment - This is not a duplicate.
            Hide
            Dongsheng Cai added a comment -

            It's a duplicate, in repository/upload/lib.php L117, if no extension provided, the code will try to add uploaded file's extension to "save as" name, I guess the regular expression there doesn't work with the extra dot well.

            Alexande, please provide exact filename you uploaded and the save as name you entered, that will help fixing this issue. And please move the discussion to MDL-29749, it's different behaviour, but same cause.

            Regards,

            Show
            Dongsheng Cai added a comment - It's a duplicate, in repository/upload/lib.php L117, if no extension provided, the code will try to add uploaded file's extension to "save as" name, I guess the regular expression there doesn't work with the extra dot well. Alexande, please provide exact filename you uploaded and the save as name you entered, that will help fixing this issue. And please move the discussion to MDL-29749 , it's different behaviour, but same cause. Regards,
            Hide
            Saswat Padhi added a comment -

            @Dongsheng Cai,

            The problem is not at repository/upload/lib.php : 117.
            The problem is at lib/moodlelib.php : 887 and lib/moodlelib.php : 897.

            Thanks,

            Show
            Saswat Padhi added a comment - @Dongsheng Cai, The problem is not at repository/upload/lib.php : 117 . The problem is at lib/moodlelib.php : 887 and lib/moodlelib.php : 897 . Thanks,

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: