async def multipart_parser(request, file_handler=default_file_handler):
multipart_data = {<EOL>'<STR_LIT>': {},<EOL>'<STR_LIT:data>': {}<EOL>}<EOL>if request.content_type == '<STR_LIT>':<EOL><INDENT>reader = MultipartReader.from_response(request)<EOL>while True:<EOL><INDENT>part = await reader.next()<EOL>if part is None:<EOL><INDENT>break<EOL><DEDENT>if isinstance(part, BodyPartReader):<EOL><INDENT>if part.filename:<EOL><INDENT>if file_handler:<EOL><INDENT>file_data = await part.read(decode=True)<EOL>file_data = part.decode(file_data)<EOL>file_path = await file_handler(part.filename, file_data, part.headers[CONTENT_TYPE])<EOL><DEDENT>else:<EOL><INDENT>file_path = part.filename<EOL><DEDENT>multipart_data['<STR_LIT>'][part.name] = file_path<EOL><DEDENT>elif part.text():<EOL><INDENT>text = await part.text()<EOL>multipart_data['<STR_LIT:data>'][part.name] = text<EOL><DEDENT>else:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>else:<EOL><INDENT>continue<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>multipart_data['<STR_LIT:data>'] = await request.json()<EOL><DEDENT>except json.JSONDecodeError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return multipart_data<EOL>
:param file_handler: callable to save file, this should always return the file path
:return: dictionary containing files and data