original_string: public function upload($saveas_filename, $maxbytes) {
          global $CFG;
  
          $types = optional_param_array('accepted_types', '*', PARAM_RAW);
          $savepath = optional_param('savepath', '/', PARAM_PATH);
          $itemid   = optional_param('itemid', 0, PARAM_INT);
          $license  = optional_param('license', $CFG->sitedefaultlicense, PARAM_TEXT);
          $author   = optional_param('author', '', PARAM_TEXT);
          $areamaxbytes = optional_param('areamaxbytes', FILE_AREA_MAX_BYTES_UNLIMITED, PARAM_INT);
          $overwriteexisting = optional_param('overwrite', false, PARAM_BOOL);
  
          return $this->process_upload($saveas_filename, $maxbytes, $types, $savepath, $itemid, $license, $author, $overwriteexisting, $areamaxbytes);
      }
code: public function upload($saveas_filename, $maxbytes) {
          global $CFG;
  
          $types = optional_param_array('accepted_types', '*', PARAM_RAW);
          $savepath = optional_param('savepath', '/', PARAM_PATH);
          $itemid   = optional_param('itemid', 0, PARAM_INT);
          $license  = optional_param('license', $CFG->sitedefaultlicense, PARAM_TEXT);
          $author   = optional_param('author', '', PARAM_TEXT);
          $areamaxbytes = optional_param('areamaxbytes', FILE_AREA_MAX_BYTES_UNLIMITED, PARAM_INT);
          $overwriteexisting = optional_param('overwrite', false, PARAM_BOOL);
  
          return $this->process_upload($saveas_filename, $maxbytes, $types, $savepath, $itemid, $license, $author, $overwriteexisting, $areamaxbytes);
      }
code_tokens: public function upload ( $ saveas_filename , $ maxbytes ) { global $ CFG ; $ types = optional_param_array ( 'accepted_types' , '*' , PARAM_RAW ) ; $ savepath = optional_param ( 'savepath' , '/' , PARAM_PATH ) ; $ itemid = optional_param ( 'itemid' , 0 , PARAM_INT ) ; $ license = optional_param ( 'license' , $ CFG -> sitedefaultlicense , PARAM_TEXT ) ; $ author = optional_param ( 'author' , '' , PARAM_TEXT ) ; $ areamaxbytes = optional_param ( 'areamaxbytes' , FILE_AREA_MAX_BYTES_UNLIMITED , PARAM_INT ) ; $ overwriteexisting = optional_param ( 'overwrite' , false , PARAM_BOOL ) ; return $ this -> process_upload ( $ saveas_filename , $ maxbytes , $ types , $ savepath , $ itemid , $ license , $ author , $ overwriteexisting , $ areamaxbytes ) ; }
docstring: Process uploaded file
  @return array|bool
docstring_tokens: Process uploaded file