简体   繁体   English

我如何将图像对象从php发送到Java Web服务

[英]how can i send image object from php to Java webservice

I need a suggestion. 我需要一个建议。 Iam developing the face recognistion webservice (SOAP) in java, but front end is php application. 我用Java开发了人脸识别Web服务(SOAP),但前端是php应用程序。 User will send the image either by capturing using webcam or uploading the image. 用户将通过使用网络摄像头捕获或上传图像来发送图像。 But i want this image and its detials as File Object in xml instead path from the server or database. 但是我想将此图像及其细节作为xml中的文件对象而不是服务器或数据库的路径。 Please suggest me how can i handle this or any other approaches. 请建议我如何处理此方法或任何其他方法。

Look at one of these: 查看以下其中一项:

$requestImageXML = '<img src="data:image/jpeg;base64,' . base64_encode(readfile($filePath)) . '"/>';
$requestImageString = base64_encode(readfile($filePath));
and use the string in a relevant way. 并以相关方式使用该字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM