Most algorithms on the Alibaba Cloud Vision Intelligence Platform have specific file type requirements. The platform determines the file type from the file URL or by decoding a Base64 string. After validating the file type, the service begins intelligent processing.
If you have questions about API integration, usage, or other issues with the Vision AI capabilities of the Alibaba Cloud Vision Intelligence Platform, contact us by joining our DingTalk group: 23109592.
An API call error similar to the one below indicates that the file type is not supported. To confirm the supported file types for a specific algorithm, check its API documentation:
{
"RequestId": "4D2E2BD6-04F5-5C1D-8601-F06AAE40E006",
"HostId": "facebody.cn-shanghai.aliyuncs.com",
"Code": "InvalidFile.Type",
"Message": "Invalid file type. Refer to the API documentation for a list of supported file types."
}
File type determination
The Alibaba Cloud Vision Intelligence Platform determines the actual file type by reading the file's content, not by its file extension. Therefore, changing a file's extension does not change its actual type.
For example, if you rename a GIF image from test.gif to test.jpg, the Alibaba Cloud Vision Intelligence Platform still recognizes it as a GIF image.
You can use a tool like MediaInfo to determine the actual type of a file. For example, a GIF file remains a GIF file internally even if you change its file extension to .jpg.
Converting file types
To convert a file's actual type, use a professional media conversion tool to re-export it in the desired format. Alternatively, you can write code to read the file and re-encode it to the new type.