Uploaded image for project: 'LAMS Development'
  1. LAMS Development
  2. LDEV-2415

Forum doesn't tell user about upload attachment size limits?

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.4
    • Component/s: Tool Forum
    • Labels:
      None

      Description

      A user had trouble figuring out why attachments couldn't be uploaded in forum - their files were too big. I assume the forum tool didn't inform them of this.

      Check that forum tool doesn't return a message about upload sizes (upload size param in configuration), and implement display of file size limit next to upload field. Also return proper error if it fails due to being too big.

        Activity

        Hide
        ernieg Ernie Ghiglione added a comment -
        Just get the value from the sysconfig setting and display it in the screen in MBs.

        Show
        ernieg Ernie Ghiglione added a comment - Just get the value from the sysconfig setting and display it in the screen in MBs.
        Hide
        ernieg Ernie Ghiglione added a comment -
        To marcin
        Show
        ernieg Ernie Ghiglione added a comment - To marcin
        Hide
        marcin Marcin Cieslak added a comment -
        Error information was not showed because the error key in i18n files was missing.
        Fixed by adding labels for this error, plus for error when user tries to upload an executable file and information about limits displayed on upload form.
        Labels probably need checking and going through translation process.
        Show
        marcin Marcin Cieslak added a comment - Error information was not showed because the error key in i18n files was missing. Fixed by adding labels for this error, plus for error when user tries to upload an executable file and information about limits displayed on upload form. Labels probably need checking and going through translation process.
        Hide
        ernieg Ernie Ghiglione added a comment -
        Marcin, just a small thing here, can we display the bytes in MBs instead? I believe the average teacher is more familiar to think in Mbs than bytes instead.

        Show
        ernieg Ernie Ghiglione added a comment - Marcin, just a small thing here, can we display the bytes in MBs instead? I believe the average teacher is more familiar to think in Mbs than bytes instead.
        Hide
        marcin Marcin Cieslak added a comment -
        Instead of setting file size unit to fixed "MB", a method from FileValidatorUtil has been reused. This method detects which unit of "B", "KB" or "MB" should be used. This way we get format like "10 KB" instead of "0.01 MB".
        This method is already used for producing errors when user tries to upload a file exceeding given size. Reusing this method for information label gives consistent information to user - see the attached screeenshot. Of course label needs to be changes in i18n files, so it does not contain word "bytes" at the end. It was corrected in ApplicationResources.properties but not in language-specific files.

        Ernie, please let me know if this solution is OK. If yes, please adjust the labels and close the JIRA. If not, I will change the unit to fixed "MB".
        Show
        marcin Marcin Cieslak added a comment - Instead of setting file size unit to fixed "MB", a method from FileValidatorUtil has been reused. This method detects which unit of "B", "KB" or "MB" should be used. This way we get format like "10 KB" instead of "0.01 MB". This method is already used for producing errors when user tries to upload a file exceeding given size. Reusing this method for information label gives consistent information to user - see the attached screeenshot. Of course label needs to be changes in i18n files, so it does not contain word "bytes" at the end. It was corrected in ApplicationResources.properties but not in language-specific files. Ernie, please let me know if this solution is OK. If yes, please adjust the labels and close the JIRA. If not, I will change the unit to fixed "MB".
        Hide
        ernieg Ernie Ghiglione added a comment -
        Done. Thanks marcin
        Show
        ernieg Ernie Ghiglione added a comment - Done. Thanks marcin
        Hide
        ernieg Ernie Ghiglione added a comment -
        Done
        Show
        ernieg Ernie Ghiglione added a comment - Done

          People

          • Assignee:
            marcin Marcin Cieslak
            Reporter:
            jundirl Jun-Dir Liew
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development