<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def scan_file(self, this_file, this_filename):
 """ Submit a file to be scanned by Malwares :param this_file: File to be scanned (200MB file size limit) :param this_filename: Filename for scanned file :return: JSON response that contains scan_id and permalink. """

        params = {
            'api_key': self.api_key,
            'filename': this_filename
        }
        try:
            files = {'file': (this_file.name, open(this_file.name, 'rb'), 'application/octet-stream')}
        except TypeError as e:
            return dict(error=e.message)

        try:
            response = requests.post(self.base + 'file/upload', files=files, data=params)
        except requests.RequestException as e:
            return dict(error=e.message)

        return _return_response_and_status_code(response)