UploadFormat is special as it throws exceptions at the get
stage before we do routing to find the correct api method to call, so settings can only be done in index.php level
If the allowedMimeTypes
are same across all api classes this is straight forward otherwise you need to do something like
if (false !== strpos($_SERVER['REQUEST_URI'], 'document')) {
UploadFormat::$allowedMimeTypes = array('application/pdf'); //,'image/jpeg'
}
In the example makes PDF as the only option when the called url contains the string "document"
We have also added a new feature today which enables handling the exception thrown at the api method level
UploadFormat::$suppressExceptionsAsError = true;
will pass the exception along with the file info