handle file upload through base64 API