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

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

XMLWordPrintable

    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • MDL-68031-file-uploaded-event
    • 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.

      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.

            Unassigned Unassigned
            andrewmadden Andrew Madden
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.