我想用java本地文件上传,但是报错com.aliyun.tea.TeaException和 java.net.SocketTimeoutException: connect timed out
Config config = new Config();
config.accessKeyId="";
config.accessKeySecret="";
config.type="access_key";
config.regionId="cn-shanghai";
config.endpointType="internal";
Client client = new Client(config);
RuntimeOptions runtimeOptions = new RuntimeOptions();
config.endpoint="ocr.cn-shanghai.aliyuncs.com";
RecognizeIdentityCardAdvanceRequest req = new RecognizeIdentityCardAdvanceRequest();
InputStream inputStream = new FileInputStream(new File("D:/back.jpg"));
req.imageURLObject=inputStream;
req.side="back";
RecognizeIdentityCardResponse rep = client.recognizeIdentityCardAdvance(req, runtimeOptions);
使用的maven依赖是
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.5.9</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>ocr20191230</artifactId>
<version>0.1.1</version>
</dependency>
需要填充: config.accessKeyId="????"; config.accessKeySecret="????"; config.type="??????";
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。