Add new File endpoint that contains ability to upload a file to files area

Bug #1950242 reported by Doris Tam
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Wishlist
Doris Tam

Bug Description

Add new File endpoint that contains ability to upload a file to files area for web services

This feature was sponsored by Universität St.Gallen. Many thanks.

Tags: newfeature
Doris Tam (doristam)
Changed in mahara:
assignee: nobody → Doris Tam (doristam)
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "main" branch: https://reviews.mahara.org/12237

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "main" branch: https://reviews.mahara.org/12248

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/12237
Committed: https://git.mahara.org/mahara/mahara/commit/3d13db8326f6ccc9415b48cc3b2957d027991119
Submitter: Robert Lyon (<email address hidden>)
Branch: main

commit 3d13db8326f6ccc9415b48cc3b2957d027991119
Author: Doris Tam <email address hidden>
Date: Tue Nov 9 16:43:48 2021 +1300

Bug 1950242: Add new file endpoint that contains ability to upload a file to files area

Test locally with:

curl --location --request POST 'http://mahara/webservice/rest/server.php' \
-F 'externalsource="test source"' \
-F 'userid="0"' \
-F 'username="admin"' \
-F 'foldername="test"' \
-F 'title="test image"' \
-F 'description="test description"' \
-F 'tags[0]="oneeee"' \
-F 'tags[1]="twooo"' \
-F 'wstoken="...your webservice token"' \
-F 'wsfunction="mahara_upload_file"' \
-F 'filetoupload=@"/home/...path to file"'

Change-Id: I5e2d32f0ce27761358f21b31d77a9a4c7918990d

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/12248
Committed: https://git.mahara.org/mahara/mahara/commit/31fd43ff2190a3337b3031407df066f81e5f4dcd
Submitter: Robert Lyon (<email address hidden>)
Branch: main

commit 31fd43ff2190a3337b3031407df066f81e5f4dcd
Author: Doris Tam <email address hidden>
Date: Wed Nov 17 17:50:57 2021 +1300

Bug 1950242: Send notificaiton for new file uploads by someone else

Check that the given username/id matches an existing person
Test with username on, and userid off and vice versa

curl --location --request POST 'http://mahara/webservice/rest/server.php' \
-F 'externalsource="unisg.ch"' \
-F 'username="admin"' \
-F 'userid="1"' \
-F 'foldername="certificates"' \
-F 'title="Certificate 101"' \
-F 'description="Certificate for the 101 course, 2021"' \
-F 'tags[0]="tag1"' \
-F 'tags[1]="tag2"' \
-F 'wstoken="...your token"' \
-F 'wsfunction="mahara_upload_file"' \
-F 'filetoupload=@"/home/...path to file"

Change-Id: Iacfb0ba3602eea49e2f4b1e084c39610290fe6e4

Robert Lyon (robertl-9)
Changed in mahara:
status: New → Fix Committed
importance: Undecided → Wishlist
milestone: none → 22.04.0
tags: added: newfeature
description: updated
Gold (gold.catalyst)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.