Moodle
  1. Moodle
  2. MDL-25634

Filepicker upload should handle files which exceed max_post_size directive in php.ini

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1
    • Component/s: Repositories
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      15727

      Description

      It cause the problem of downloading repository_ajax.php

        Activity

        Hide
        Dongsheng Cai added a comment -

        fixed

        Show
        Dongsheng Cai added a comment - fixed
        Hide
        Chris Fryer added a comment -

        I still experience this issue when using Internet Explorer 8, even after this fix has been applied. I have an association for the extension php, which causes Internet Explorer to offer repository_ajax.php for download.

        PHP 5.2.8-1bunny2 with Suhosin-Patch 0.9.6.3
        Apache 2.2.9
        Internet Explorer 8.0.6001.18702
        Windows XP Service Pack 3

        Steps to reproduce:

        In a course, turn editing on
        Add a resource->File
        In the section headed "Content", click "Add"
        Browse for an attachment, and click "upload this file"

        Observed behaviour:
        I am prompted to download repository_ajax.php, which contains JSON, e.g.

        {"url":"http:\/\/moodletest.lse.ac.uk\/moodle-2.0\/draftfile.php\/14\/user\/draft\/334852668\/air-baloon","id":334852668,"file":"air-baloon"}
        

        This is happening when the uploaded file is smaller than post_max_size. I think it is caused by line 67:

        $OUTPUT->header();
        

        This sends the header "Content-Type: text/plain", which causes repository_ajax.php to be downloaded. Commenting out $OUTPUT->header(), which appears to be superfluous, means the content-type is set to "text/html". This is still incorrect – it should be "application/json" – but at least it allows you to upload the file.

        Show
        Chris Fryer added a comment - I still experience this issue when using Internet Explorer 8, even after this fix has been applied. I have an association for the extension php, which causes Internet Explorer to offer repository_ajax.php for download. PHP 5.2.8-1bunny2 with Suhosin-Patch 0.9.6.3 Apache 2.2.9 Internet Explorer 8.0.6001.18702 Windows XP Service Pack 3 Steps to reproduce: In a course, turn editing on Add a resource->File In the section headed "Content", click "Add" Browse for an attachment, and click "upload this file" Observed behaviour: I am prompted to download repository_ajax.php, which contains JSON, e.g. { "url" : "http:\/\/moodletest.lse.ac.uk\/moodle-2.0\/draftfile.php\/14\/user\/draft\/334852668\/air-baloon" , "id" :334852668, "file" : "air-baloon" } This is happening when the uploaded file is smaller than post_max_size. I think it is caused by line 67: $OUTPUT->header(); This sends the header "Content-Type: text/plain", which causes repository_ajax.php to be downloaded. Commenting out $OUTPUT->header(), which appears to be superfluous, means the content-type is set to "text/html". This is still incorrect – it should be "application/json" – but at least it allows you to upload the file.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: