Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于html页面显示图片的问题 #3

Closed
MoJimmy opened this issue Nov 16, 2016 · 3 comments
Closed

关于html页面显示图片的问题 #3

MoJimmy opened this issue Nov 16, 2016 · 3 comments

Comments

@MoJimmy
Copy link

MoJimmy commented Nov 16, 2016

我有一个需求是服务器同时返回一段文本和一张图片。
我尝试过的方法:
1、在setHttpAcceptedCallback回调中同时调用
{
session->replyText(...)
session->replyImage(...)
}
这样会出现 服务器程序停止运行

2、我用session->replyFile 函数返回一个html 文件

(代码格式是故意少写了<,不然该页面不能显示)
html>
body >
img src ="http://www.baidu.com/img/bd_logo1.png" />
img src ="http://192.168.31.101:23412/bb.png"/>
/body>
/html>

第一张百度图片显示正常。
第二张图片是我服务器上的图片,不能正常显示。

请问是否我图片路径有问题,通过html方法如何访问我的服务器图片

@188080501
Copy link
Owner

关于问题1,HTTP也不支持你这么做,不建议同时返回图片和文字

@188080501
Copy link
Owner

关于问题2,我不是很清楚怎么回事

@MoJimmy
Copy link
Author

MoJimmy commented Nov 16, 2016

该库有没有一个类似apache 的web根目录,我把图片放进去该目录,就可以通过链接访问。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants