Allow file upload on rest requests

Allow file upload on rest requests. I am not sure the preg_match call is the best way :confused: !