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

Add event for when file is uploaded using core_files_upload external function.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.10, 3.6.8, 3.7.4, 3.8
    • Fix Version/s: None
    • Component/s: Files API, Web Services
    • Testing Instructions:
      Hide

      Setup web service.

      Goto site administration->plugins->web services->overview and keep it open as you follow the steps to set up web service.
      1. Enable web service with checkbox.
      2. Enable REST protocol.
      3. Create a new user to use the web service with username set to webserviceuser.
      3a. Goto site administration->users->site administrators and add webserviceuser as a site admin.
      4. User should be site admin so skip this step.
      5. Add a new external service with shortname uploadfile, 'enabled' and 'authorised users only' checkboxes checked.
      6. Click add a function and search for 'core_files_upload' and add it.
      7. On external services page, click Authorised users and add webserviceuser to authorized users.
      8. Select the webserviceuser, the uploadfile service and click save changes to set up a token. Save the token somewhere for use.
      9. Skip this step.
      10. We'll do this manually.

      Use the web service.

      1.

      Test that the event was triggered.

      Show
      Setup web service. Goto site administration->plugins->web services->overview and keep it open as you follow the steps to set up web service. 1. Enable web service with checkbox. 2. Enable REST protocol. 3. Create a new user to use the web service with username set to webserviceuser . 3a. Goto site administration->users->site administrators and add webserviceuser as a site admin. 4. User should be site admin so skip this step. 5. Add a new external service with shortname uploadfile , 'enabled' and 'authorised users only' checkboxes checked. 6. Click add a function and search for 'core_files_upload' and add it. 7. On external services page, click Authorised users and add webserviceuser to authorized users. 8. Select the webserviceuser, the uploadfile service and click save changes to set up a token. Save the token somewhere for use. 9. Skip this step. 10. We'll do this manually. Use the web service. 1. Test that the event was triggered.
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-68031-file-uploaded-event

      Description

      Currently there is no event for this external function, meaning no observers can be set up to monitor when the external function is used.

      It would be useful to have a `file_uploaded` event.

        Attachments

          Activity

            People

            Assignee:
            kennethhendricks Kenneth Hendricks
            Reporter:
            andrewmadden Andrew Madden
            Participants:
            Component watchers:
            Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: