|
|
|
|
|
|
|
|
ext = path.splitext(url)[1] |
|
|
ext = path.splitext(url)[1] |
|
|
mimetype = response.meta.get('mime_type', 'image/jpeg') |
|
|
mimetype = response.meta.get('mime_type', 'image/jpeg') |
|
|
filename = response.save_as or url.split('/')[-1] |
|
|
filename = response.save_as or url.split('/')[-1] |
|
|
|
|
|
transfer_method = response.meta.get('transfer_method', FileTransferMethod.TOOL_FILE) |
|
|
|
|
|
|
|
|
# get tool file id |
|
|
# get tool file id |
|
|
tool_file_id = url.split('/')[-1].split('.')[0] |
|
|
tool_file_id = url.split('/')[-1].split('.')[0] |
|
|
result.append(FileVar( |
|
|
result.append(FileVar( |
|
|
tenant_id=self.tenant_id, |
|
|
tenant_id=self.tenant_id, |
|
|
type=FileType.IMAGE, |
|
|
type=FileType.IMAGE, |
|
|
transfer_method=FileTransferMethod.TOOL_FILE, |
|
|
|
|
|
|
|
|
transfer_method=transfer_method, |
|
|
url=url, |
|
|
url=url, |
|
|
related_id=tool_file_id, |
|
|
related_id=tool_file_id, |
|
|
filename=filename, |
|
|
filename=filename, |