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

Allow Cross-Origin requests in webservice/upload.php

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      2. Create a Token in the mobile app service for one user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      3. Unzip the attached zip file
      4. Edit the unzipped js/script.js file, look for the line starting by oXHR.open('POST', and change the Moodle URL with your one, replace the token with the token generated in step 2
      5. Open the unzipped index.html in a browser
      6. Upload a file via the index.html form and check that you receive a response similar to the attached expected-response.png (it may change some values like the itemid, filename, contextid, userid)
      Show
      As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for one user: Click on Site administration ► Plugins ► Web services ► Manage tokens Unzip the attached zip file Edit the unzipped js/script.js file, look for the line starting by oXHR.open('POST', and change the Moodle URL with your one, replace the token with the token generated in step 2 Open the unzipped index.html in a browser Upload a file via the index.html form and check that you receive a response similar to the attached expected-response.png (it may change some values like the itemid, filename, contextid, userid)
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-60302-master

      Description

      It would be good to ad a 'Access-Control-Allow-Origin: *' header in upload.php to allow cross origin requests.

      If allowed you could upload files over webservice/upload.php from chrome or firefox.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17