Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi all,
I am developing a Dynamic application which can download web pages using IWEB_GetResponse(). I am able download the Text content of the web page successfully.
But i don't see any images downloaded. Does IWEB interface really download the images too or we need to follow any other procedure to download the embedded images of the web page?

If possible, can somebody post code snippets which involves sequence of API calls?

Here is the sequence of operation i am using:
CALLBACK_Init(&net->httpCallback, HTTP_GotResponse, appNet);
IWEB_GetResponse(net->web, (net->web, &net->httpResp, &net->httpCallback, net->urlName,.......)

void HTTP_GotResponse(){
net->httpRespInfo = IWEBRESP_GetInfo(net->httpResp);

CALLBACK_Init(&net->httpCallback, GetData, appNet);
net->iSource = net->httpRespInfo->pisMessage;
ISOURCE_Readable(net->iSource, &net->httpCallback);

int Getdata() {
char buf[HTTP_BUFFER_SIZE];

MEMSET((char*)buf, 0, HTTP_BUFFER_SIZE); // Reset buffer

int bytesRead = ISOURCE_Read(net->iSource, (char *)buf, HTTP_BUFFER_SIZE);

if (bytesRead > 0)
{

// Write the the data to the local file
if (IFILE_Write(net->file, buf, bytesRead) == 0)
{
DisplayErrorMessage(appNet, "Can not write to file", 0xFFFFF50E);

return HTTP_DOWNLOAD_FAILED;
}
}

The embedded images are actually links to the image in other place in the web so if you want to download the images also you have to parse the HTML you downloaded ,then get the image link and then you can download the image.

The embedded images are actually links to the image in other place in the web so if you want to download the images also you have to parse the HTML you downloaded ,then get the image link and then you can download the image.

IHTMLVIEWER_SetIWeb()
Description:
This function is a shorthand function for IHTMLVIEWER_SetOption (HVOPT_PTR_IWEB). It sets the IWeb interface with which the viewer will use to obtain sub-objects.

IHTMLVIEWER_SetIWeb()
Description:
This function is a shorthand function for IHTMLVIEWER_SetOption (HVOPT_PTR_IWEB). It sets the IWeb interface with which the viewer will use to obtain sub-objects.

mohlendo wrote:IHTMLVIEWER_SetIWeb()
Description:
This function is a shorthand function for IHTMLVIEWER_SetOption (HVOPT_PTR_IWEB). It sets the IWeb interface with which the viewer will use to obtain sub-objects.
thanks for the reply.
but i am not sure how i need to use that API though the interface pointers for IHtmlViewer and IWeb are available.
If possible, can anybody post sequence of operations to be performed using IHTMLVIEWER_SetIWeb() API?
Please look at my first post to know sequence of operations i am performing to download the text content.

mohlendo wrote:IHTMLVIEWER_SetIWeb()
Description:
This function is a shorthand function for IHTMLVIEWER_SetOption (HVOPT_PTR_IWEB). It sets the IWeb interface with which the viewer will use to obtain sub-objects.
thanks for the reply.
but i am not sure how i need to use that API though the interface pointers for IHtmlViewer and IWeb are available.
If possible, can anybody post sequence of operations to be performed using IHTMLVIEWER_SetIWeb() API?
Please look at my first post to know sequence of operations i am performing to download the text content.

I meet a problem same as Mr. sreenivas.yarra.
I don't get the right images data downloaded in GetData() callback function by IWEB interface too, the URL was a images link like "htttp://192.168.51.21/mm.jpg", which can be sended by IWEB_GetResponse() successfully.
The text content of the web page is able to be downloaded too.
Pray someone to help us and give some advice.
Thanks!

I meet a problem same as Mr. sreenivas.yarra.
I don't get the right images data downloaded in GetData() callback function by IWEB interface too, the URL was a images link like "htttp://192.168.51.21/mm.jpg", which can be sended by IWEB_GetResponse() successfully.
The text content of the web page is able to be downloaded too.
Pray someone to help us and give some advice.
Thanks!

I finished my downlaod embedded image code by the IWEB interface got image data. It is my mistake that the failure image data is because the data recombination has some flaw. If someone not slove the problem all the same you could send message to me.
P. S. my e-mail: eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%79%75%79%61%6e%67%2e%64%6c%75%74%40%31%36%33%2e%63%6f%6d%22%20%63%6c%61%73%73%3d%22%62%62%2d%65%6d%61%69%6c%22%3e%79%75%79%61%6e%67%2e%64%6c%75%74%40%31%36%33%2e%63%6f%6d%3c%2f%61%3e%27%29%3b'))

I finished my downlaod embedded image code by the IWEB interface got image data. It is my mistake that the failure image data is because the data recombination has some flaw. If someone not slove the problem all the same you could send message to me.
P. S. my e-mail: eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%79%75%79%61%6e%67%2e%64%6c%75%74%40%31%36%33%2e%63%6f%6d%22%20%63%6c%61%73%73%3d%22%62%62%2d%65%6d%61%69%6c%22%3e%79%75%79%61%6e%67%2e%64%6c%75%74%40%31%36%33%2e%63%6f%6d%3c%2f%61%3e%27%29%3b'))