diff --git a/webservice/upload.php b/webservice/upload.php
index <HASH>..<HASH> 100644
--- a/webservice/upload.php
+++ b/webservice/upload.php
@@ -68,6 +68,11 @@ if ($fileuploaddisabled) {
 $context = context_user::instance($USER->id);
 require_capability('moodle/user:manageownfiles', $context);
 
+if ($filearea !== 'private' and $filearea !== 'draft') {
+    // Do not dare to allow more areas here!
+    throw new file_exception('error');
+}
+
 $fs = get_file_storage();
 
 $totalsize = 0;
MDL-<I> ws: verify upload areas