Upload a file to a hydroshare resource.

        :param payload:
            file: File object to upload to server
            folder: folder path to upload the file to
        :return: json object
            resource_id: string resource id,
            file_name: string name of file

def files(self, payload):
        """Upload a file to a hydroshare resource.

        :param payload:
            file: File object to upload to server
            folder: folder path to upload the file to
        :return: json object
            resource_id: string resource id,
            file_name: string name of file
        """
        url = "{url_base}/resource/{pid}/files/".format(url_base=self.hs.url_base,
                                                       pid=self.pid)

        encoder = MultipartEncoder({
            "file": (payload['file'], open(payload['file'], 'r')),
            "folder": payload['folder']
        })
        monitor = MultipartEncoderMonitor(encoder, default_progress_callback)

        r = self.hs._request('POST', url, None, data=monitor, headers={'Content-Type': monitor.content_type})
        return r.text