downloading problem | developer.brewmp.com downloading problem | developer.brewmp.com

Developer

downloading problem

Forums:

how to download 2 or more files at a time..
i m downloading one file but i m getting problem in downloading 2 files
pls reply

How you are downloading can you exaplain? I mean by using IWeb or ISocket?
Regards,
Vishal

How you are downloading can you exaplain? I mean by using IWeb or ISocket?
Regards,
Vishal

thnx vishal 4 replying
i m downloading by using iweb
is it ok 4 downloading more than 1 file
pls reply
thnx

thnx vishal 4 replying
i m downloading by using iweb
is it ok 4 downloading more than 1 file
pls reply
thnx

hi,
You can donwnload as many files as you want. As you download first file, When you get the ISOURCE_END then go for other file for downloading. You have to provide the link of next file.
Actually its depend on your logic that whether you want to downlod all the files at a time or 1 by 1.
If you want to download at a time then you can use the IFILEMGR_EnumInit()
and IFILEMGR_EnumNext() to check all the files in the perticular folder which is at server.
Regards,
Vishal

hi,
You can donwnload as many files as you want. As you download first file, When you get the ISOURCE_END then go for other file for downloading. You have to provide the link of next file.
Actually its depend on your logic that whether you want to downlod all the files at a time or 1 by 1.
If you want to download at a time then you can use the IFILEMGR_EnumInit()
and IFILEMGR_EnumNext() to check all the files in the perticular folder which is at server.
Regards,
Vishal

ok i will try
thnx a lot vishal

ok i will try
thnx a lot vishal

vishal do u know how to increase the speed of downloading
i m downloading files 1 by 1.
but it takes few minutes 4 downloading(atleast 3/4 minutes ..sometimes more than that)
do u have any idea??
pls reply

vishal do u know how to increase the speed of downloading
i m downloading files 1 by 1.
but it takes few minutes 4 downloading(atleast 3/4 minutes ..sometimes more than that)
do u have any idea??
pls reply

ssp wrote:vishal do u know how to increase the speed of downloading
i m downloading files 1 by 1.
but it takes few minutes 4 downloading(atleast 3/4 minutes ..sometimes more than that)
do u have any idea??
pls reply
hi,
Downloading speed is completely depend on the carrier's network. It is not in our hand to increase its speed.
But you can do one thing, you can increase the no. of bytes downloading at a time. say 1000 bytes per download but there is a chance of data loss.
This will help you little bit.
Regards,
Vishal

ssp wrote:vishal do u know how to increase the speed of downloading
i m downloading files 1 by 1.
but it takes few minutes 4 downloading(atleast 3/4 minutes ..sometimes more than that)
do u have any idea??
pls reply
hi,
Downloading speed is completely depend on the carrier's network. It is not in our hand to increase its speed.
But you can do one thing, you can increase the no. of bytes downloading at a time. say 1000 bytes per download but there is a chance of data loss.
This will help you little bit.
Regards,
Vishal

Quote:hi,
Downloading speed is completely depend on the carrier's network. It is not in our hand to increase its speed.
But you can do one thing, you can increase the no. of bytes downloading at a time. say 1000 bytes per download but there is a chance of data loss.
This will help you little bit.
Regards,
Vishal
HI Vishal,
When you are using TCP, How can you loss data. :eek:
There is no way you will lose data. only tink you have to re -read the socket to get the last bits.

Quote:hi,
Downloading speed is completely depend on the carrier's network. It is not in our hand to increase its speed.
But you can do one thing, you can increase the no. of bytes downloading at a time. say 1000 bytes per download but there is a chance of data loss.
This will help you little bit.
Regards,
Vishal
HI Vishal,
When you are using TCP, How can you loss data. :eek:
There is no way you will lose data. only tink you have to re -read the socket to get the last bits.

Yeah sunil you are right when we use UDP then there is a chances of data loss.
But when we use TCP then there is some limits on downloading bytes. By using ISocket I found that it is 1436 bytes at a time.
We can not download more than 1500 bytes at a time using TCP.
Correct me if I am wrong.
Regards,
Vishal

Yeah sunil you are right when we use UDP then there is a chances of data loss.
But when we use TCP then there is some limits on downloading bytes. By using ISocket I found that it is 1436 bytes at a time.
We can not download more than 1500 bytes at a time using TCP.
Correct me if I am wrong.
Regards,
Vishal

Vishal,
NOTE: TCP will never ever loss data. ;)
I have developed some FTP type of applications on BREW that transfers min 2 MB of Data from server to client. Also i am finishing one streaming application that transfers many MB's of data to device with no Problem :rolleyes:

Vishal,
NOTE: TCP will never ever loss data. ;)
I have developed some FTP type of applications on BREW that transfers min 2 MB of Data from server to client. Also i am finishing one streaming application that transfers many MB's of data to device with no Problem :rolleyes:

Hi Sunil,
I got that TCP will never ever loss data. I am talking about at one read operation from server we can not read more than 1500 bytes(or vary near about). We can donwload as many bytes as we want by continuosly calling callback function for reading till the data is over.
Reagards,
Vishal

Hi Sunil,
I got that TCP will never ever loss data. I am talking about at one read operation from server we can not read more than 1500 bytes(or vary near about). We can donwload as many bytes as we want by continuosly calling callback function for reading till the data is over.
Reagards,
Vishal

Quote:but there is a chance of data loss.
Yeap that is what i am saying. :o

Quote:but there is a chance of data loss.
Yeap that is what i am saying. :o

Hi sunil,
Do you have any idea about download item id of the game/application.
I want to invoke perticular item from mobile shop. I am using
ISHELL_GetClassItemId() I got 10 digit no. but still I am not able to invoke the perticular item from this id. I got the message No Items were found.
I have already posted this query in othe posts but no reply is there.
If you come across this problem please help me.
Regards,
Vishal

Hi sunil,
Do you have any idea about download item id of the game/application.
I want to invoke perticular item from mobile shop. I am using
ISHELL_GetClassItemId() I got 10 digit no. but still I am not able to invoke the perticular item from this id. I got the message No Items were found.
I have already posted this query in othe posts but no reply is there.
If you come across this problem please help me.
Regards,
Vishal

Sorry Vishal i have not any experiance with ISHELL_GetClassItemID(), i will ask my friends to look in the problem and if possiable replay to your post.

Sorry Vishal i have not any experiance with ISHELL_GetClassItemID(), i will ask my friends to look in the problem and if possiable replay to your post.

Ok Thanks!!!!!!
Regards,
vishal

Ok Thanks!!!!!!
Regards,
vishal

hey i on my device i m trying with some other application it downloads the page within few seconds but for my application on same device it takes more than 3 or 4 minutes and most of times it gore to error page .
wht must be the problem u think.
but the connection code for both the aplication is the same.
My buffer size is 1500.
and i m using url to connect to website

hey i on my device i m trying with some other application it downloads the page within few seconds but for my application on same device it takes more than 3 or 4 minutes and most of times it gore to error page .
wht must be the problem u think.
but the connection code for both the aplication is the same.
My buffer size is 1500.
and i m using url to connect to website

if you can post the code to read the page from the web then we may tell what is going on. :rolleyes:

if you can post the code to read the page from the web then we may tell what is going on. :rolleyes:

ReadWebSite
{
int nCharsRead;
manApp * pMe;
// since this is a generic callback, we passed in the pMe pointer
// as a (void *). So assign it properly.
pMe = (manApp*) pPointer;
// we're past the errors, so show we're connected!
pMe->nCurrentState=DOWNLOADING;
// here is where we actually read the data coming down the "source"
// we'll only read enough to fill the buffer, then below we'll ask
// to be notified again when more data comes in, and we'll read again
if(pMe->pISource)
{
nCharsRead = ISOURCE_Read(pMe->pISource, // Isource interface
pMe->stFileBuffer, // buffer to read into
sizeof(pMe->stFileBuffer)); // size of the buffer
// here is where we check to see how the read went.
// we can either get the number of chars successfully read, ISOURCE_END,
// ISORUCE_ERROR, or ISOURCE_WAIT
switch(nCharsRead)
{
// there is no data currently available to read, so simply register again
case ISOURCE_WAIT:
CALLBACK_Init(&pMe->ISourceReadCB, ReadFromWebSiteCB, pMe);
ISOURCE_Readable(pMe->pISource, &pMe->ISourceReadCB);
return;
// this is our "end-of-file". The site closed successfully and we're all done!
case ISOURCE_END:
// close the opened file that we've been writing to, and we're done
if(pMe->pIFile)
{
IFILE_Release(pMe->pIFile);
pMe->pIFile = NULL;
}
// close the opened Web Response we've been reading the data from
if(pMe->pIWebResponse)
{
IWEBRESP_Release(pMe->pIWebResponse);
pMe->pIWebResponse = NULL;
}
// let everyone know that the file was downloaded successfully
pMe->nCurrentState = DOWNLOADED;
return;
// there was an error getting the data over the web
case ISOURCE_ERROR:
// close the opened file since there was an error
if(pMe->pIFile)
{
IFILE_Release(pMe->pIFile);
pMe->pIFile = NULL;
}
// close the opened Web Response we've been reading the data from
if(pMe->pIWebResponse)
{
IWEBRESP_Release(pMe->pIWebResponse);
pMe->pIWebResponse = NULL;
}
pMe->nCurrentState=ERROR_WEB_READ;
return;
}
// since we're still here it meant that we read successfully, so write that
// data into the file.
IFILE_Write(pMe->pIFile, pMe->stFileBuffer, nCharsRead);
STR_TO_WSTR(pMe->stFileBuffer, pMe->stFileBuffer1, sizeof(pMe->stFileBuffer1));
if(IFILEMGR_GetLastError(pMe->pIFileMgr))
{
/* error = IFILEMGR_GetLastError(pMe->pFileMgr);
error = EFILEEXISTS;// File exists.
error = EFILENOEXISTS;// File does not exist.
error = EDIRNOTEMPTY;// Directory not empty.
error = EBADFILENAME;// Bad file name.
error = EBADSEEKPOS;// Bad seek position.
error = EFILEEOF;// End of file.
error = EFSFULL;// File system full.
error = EFILEOPEN;// File already open.
error = EBADPARM;// Invalid parameter.
*/
if(pMe->pIFile)
{
IFILE_Release(pMe->pIFile);
pMe->pIFile = NULL;
}
IFILEMGR_Remove(pMe->pIFileMgr, pMe->pFileName);
pMe->nCurrentState = ERROR_EFSFULL;
}
// now that we've read a chunk of data over the web and written that chunk
// into the file, we'll register to be called back as soon as there is more
// data to be read. We'll keep looping like this until all data is read (or error).
}
CALLBACK_Init(&pMe->ISourceReadCB, ReadFromWebSiteCB, pMe);
ISOURCE_Readable(pMe->pISource, &pMe->ISourceReadCB);
DBGPRINTF("i m in read frm website web");

void WebResponseScreen(manApp *pMe)
{
AEEImageInfo imageInfo;
pMe->num1=0;
switch(pMe->nCurrentState)
{
char FileBuf[1400];
FileCache fc;
int i=0,l=0,j=0,k=0,l1=0,s=0,cnt=0,l2=0;
char *arr=NULL;
case CONNECTING:
if(pMe->pIImage[SPRITE_CONNECTING])
{
IIMAGE_SetParm(pMe->pIImage[SPRITE_CONNECTING], IPARM_RATE, 600, 0);
IIMAGE_Start(pMe->pIImage[SPRITE_CONNECTING],0,0);
}
break;
case ERROR_NOMEMORY:
case ERROR_NONETWORK:
case ERROR_NETERROR:
IIMAGE_Stop(pMe->pIImage[SPRITE_CONNECTING]);
if(pMe->pIImage[SPRITE_NET_ERROR])
IIMAGE_Draw(pMe->pIImage[SPRITE_NET_ERROR], 0, 0);
if(pMe->WebReadCB.pfnCancel)
CALLBACK_Cancel(&pMe->WebReadCB);
if(pMe->pIWebResponse)
{
IWEBRESP_Release(pMe->pIWebResponse);
pMe->pIWebResponse = NULL;
}
break;
case DOWNLOADING:
IIMAGE_Stop(pMe->pIImage[SPRITE_CONNECTING]);
if(pMe->pIImage[SPRITE_DOWNLOADING])
{
IIMAGE_SetParm(pMe->pIImage[SPRITE_DOWNLOADING], IPARM_RATE, 600, 0);
IIMAGE_Start(pMe->pIImage[SPRITE_DOWNLOADING],0,0);
}
break;
case ERROR_EFSFULL:
IIMAGE_Stop(pMe->pIImage[SPRITE_DOWNLOADING]);
if(pMe->nDelay < 15)
{
if(pMe->pIImage[SPRITE_MEMMORY_ERROR])
IIMAGE_Draw(pMe->pIImage[SPRITE_MEMMORY_ERROR],0,0);
pMe->nDelay++;
}
if(pMe->nDelay == 15)
{
ISHELL_CloseApplet(pMe->a.m_pIShell,FALSE);
}
break;
case ERROR_WEB_READ:
IIMAGE_Stop(pMe->pIImage[SPRITE_DOWNLOADING]);
if(pMe->pIImage[SPRITE_NET_ERROR])
IIMAGE_Draw(pMe->pIImage[SPRITE_NET_ERROR], 0, 0);
if(pMe->WebReadCB.pfnCancel)
CALLBACK_Cancel(&pMe->WebReadCB);
if(pMe->ISourceReadCB.pfnCancel)
CALLBACK_Cancel(&pMe->ISourceReadCB);
if(pMe->pIWebResponse)
{
IWEBRESP_Release(pMe->pIWebResponse);
pMe->pIWebResponse = NULL;
}
break;
case DOWNLOADED:
pMe->prevLingerTime = INETMGR_SetLinger (pMe->pINetMgr, pMe->lingerTime2);
if(pMe->num==0)
{
pMe->num1=1;
pMe->num2=1;
pMe->count=0;
pMe->pIFile = IFILEMGR_OpenFile(pMe->pIFileMgr,pMe->pFileName, _OFM_READ);
cnt=0;
if (pMe->pIFile)
{
MEMSET(&fc, 0 , sizeof(fc));
j=0;
while (ReadLine(pMe,pMe->pIFile,&fc, FileBuf, sizeof(FileBuf)) >= 0)
{
char* tab = STRCHR(FileBuf, '\0');
if (tab)
{
AECHAR WideBuf[1400];
const char* DataCopy = STRDUP(FileBuf);
if (DataCopy)
{
*tab = 0;
STR_TO_WSTR(FileBuf, WideBuf, sizeof(WideBuf));
l=STRLEN(FileBuf);
for(i=0;iFileBuf1+i)=*(FileBuf+i);
}
*(pMe->FileBuf1+i)='\0';
for(i=0;iFileBuf2[cnt][i]=*(pMe->FileBuf1+0+i));
}
pMe->FileBuf2[cnt][l]='\0';
}
FREEIF(DataCopy);
DataCopy=NULL;
}
pMe->count++;
cnt++;
j++;
}
if( IFILEMGR_Test(pMe->pIFileMgr, pMe->pFileName) == SUCCESS )
{
// A file exists with that name so delete it.
IFILE_Release(pMe->pIFile);
pMe->pIFile=NULL;
IFILEMGR_Remove(pMe->pIFileMgr, pMe->pFileName);
}
}
if(pMe->num==0)
{
s=0;
while(pMe->FileBuf2[0][s]!='\0')
{
*(pMe->arr1+s)=pMe->FileBuf2[0][s];
s++;
}
*(pMe->arr1+s)='\0';
pMe->num++;
}
pMe->num=0;

if(pMe->num1==1)
{
pMe->num=100;
pMe->pFileName=pMe->arr1;
pMe->pFileName1="gadget.txt";
ConnectToWebsite(pMe, pMe->stURLPath, pMe->pFileName);//gadget.png
// ConnectToWebsite(pMe, pMe->stURLPath, pMe->pFileName1);
}
else
{
if( STRENDS(".txt", pMe->pFileName)==TRUE)
//if((STRCMP(pMe->pFileName,"gadget.txt")==0)|| (STRCMP(pMe->pFileName,"gadget1.txt")==0))
{
IIMAGE_Stop(pMe->pIImage[SPRITE_CONNECTING]);
IIMAGE_Stop(pMe->pIImage[SPRITE_DOWNLOADING]);
if(pMe->pIImage[SPRITE_DOWNLOADING])
IIMAGE_Draw(pMe->pIImage[SPRITE_DOWNLOADING],0,0);
pMe->nPage = ARCHICE_COMIC_PAGEF;
}
else if( STRENDS(".png", pMe->pFileName)==TRUE)
{
if(!(pMe->pIImage[SPRITE_ARCHIE_COMIC]))
pMe->pIImage[SPRITE_ARCHIE_COMIC] = ISHELL_LoadImage(pMe->a.m_pIShell, pMe->pFileName);
if(pMe->pIImage[SPRITE_ARCHIE_COMIC])
{
IIMAGE_SetParm(pMe->pIImage[SPRITE_ARCHIE_COMIC],IPARM_ROP,AEE_RO_TRANSPARENT,0);
IIMAGE_GetInfo(pMe->pIImage[SPRITE_ARCHIE_COMIC],&imageInfo);
pMe->nImageHeight = imageInfo.cy;
}
IIMAGE_Stop(pMe->pIImage[SPRITE_DOWNLOADING]);
if(pMe->pIImage[SPRITE_DOWNLOADING])
IIMAGE_Draw(pMe->pIImage[SPRITE_DOWNLOADING],0,0);
pMe->nPage = ARCHICE_COMIC_PAGE;
}
}
break;
DBGPRINTF("i m in web resp screen");
}

ReadWebSite
{
int nCharsRead;
manApp * pMe;
// since this is a generic callback, we passed in the pMe pointer
// as a (void *). So assign it properly.
pMe = (manApp*) pPointer;
// we're past the errors, so show we're connected!
pMe->nCurrentState=DOWNLOADING;
// here is where we actually read the data coming down the "source"
// we'll only read enough to fill the buffer, then below we'll ask
// to be notified again when more data comes in, and we'll read again
if(pMe->pISource)
{
nCharsRead = ISOURCE_Read(pMe->pISource, // Isource interface
pMe->stFileBuffer, // buffer to read into
sizeof(pMe->stFileBuffer)); // size of the buffer
// here is where we check to see how the read went.
// we can either get the number of chars successfully read, ISOURCE_END,
// ISORUCE_ERROR, or ISOURCE_WAIT
switch(nCharsRead)
{
// there is no data currently available to read, so simply register again
case ISOURCE_WAIT:
CALLBACK_Init(&pMe->ISourceReadCB, ReadFromWebSiteCB, pMe);
ISOURCE_Readable(pMe->pISource, &pMe->ISourceReadCB);
return;
// this is our "end-of-file". The site closed successfully and we're all done!
case ISOURCE_END:
// close the opened file that we've been writing to, and we're done
if(pMe->pIFile)
{
IFILE_Release(pMe->pIFile);
pMe->pIFile = NULL;
}
// close the opened Web Response we've been reading the data from
if(pMe->pIWebResponse)
{
IWEBRESP_Release(pMe->pIWebResponse);
pMe->pIWebResponse = NULL;
}
// let everyone know that the file was downloaded successfully
pMe->nCurrentState = DOWNLOADED;
return;
// there was an error getting the data over the web
case ISOURCE_ERROR:
// close the opened file since there was an error
if(pMe->pIFile)
{
IFILE_Release(pMe->pIFile);
pMe->pIFile = NULL;
}
// close the opened Web Response we've been reading the data from
if(pMe->pIWebResponse)
{
IWEBRESP_Release(pMe->pIWebResponse);
pMe->pIWebResponse = NULL;
}
pMe->nCurrentState=ERROR_WEB_READ;
return;
}
// since we're still here it meant that we read successfully, so write that
// data into the file.
IFILE_Write(pMe->pIFile, pMe->stFileBuffer, nCharsRead);
STR_TO_WSTR(pMe->stFileBuffer, pMe->stFileBuffer1, sizeof(pMe->stFileBuffer1));
if(IFILEMGR_GetLastError(pMe->pIFileMgr))
{
/* error = IFILEMGR_GetLastError(pMe->pFileMgr);
error = EFILEEXISTS;// File exists.
error = EFILENOEXISTS;// File does not exist.
error = EDIRNOTEMPTY;// Directory not empty.
error = EBADFILENAME;// Bad file name.
error = EBADSEEKPOS;// Bad seek position.
error = EFILEEOF;// End of file.
error = EFSFULL;// File system full.
error = EFILEOPEN;// File already open.
error = EBADPARM;// Invalid parameter.
*/
if(pMe->pIFile)
{
IFILE_Release(pMe->pIFile);
pMe->pIFile = NULL;
}
IFILEMGR_Remove(pMe->pIFileMgr, pMe->pFileName);
pMe->nCurrentState = ERROR_EFSFULL;
}
// now that we've read a chunk of data over the web and written that chunk
// into the file, we'll register to be called back as soon as there is more
// data to be read. We'll keep looping like this until all data is read (or error).
}
CALLBACK_Init(&pMe->ISourceReadCB, ReadFromWebSiteCB, pMe);
ISOURCE_Readable(pMe->pISource, &pMe->ISourceReadCB);
DBGPRINTF("i m in read frm website web");

void WebResponseScreen(manApp *pMe)
{
AEEImageInfo imageInfo;
pMe->num1=0;
switch(pMe->nCurrentState)
{
char FileBuf[1400];
FileCache fc;
int i=0,l=0,j=0,k=0,l1=0,s=0,cnt=0,l2=0;
char *arr=NULL;
case CONNECTING:
if(pMe->pIImage[SPRITE_CONNECTING])
{
IIMAGE_SetParm(pMe->pIImage[SPRITE_CONNECTING], IPARM_RATE, 600, 0);
IIMAGE_Start(pMe->pIImage[SPRITE_CONNECTING],0,0);
}
break;
case ERROR_NOMEMORY:
case ERROR_NONETWORK:
case ERROR_NETERROR:
IIMAGE_Stop(pMe->pIImage[SPRITE_CONNECTING]);
if(pMe->pIImage[SPRITE_NET_ERROR])
IIMAGE_Draw(pMe->pIImage[SPRITE_NET_ERROR], 0, 0);
if(pMe->WebReadCB.pfnCancel)
CALLBACK_Cancel(&pMe->WebReadCB);
if(pMe->pIWebResponse)
{
IWEBRESP_Release(pMe->pIWebResponse);
pMe->pIWebResponse = NULL;
}
break;
case DOWNLOADING:
IIMAGE_Stop(pMe->pIImage[SPRITE_CONNECTING]);
if(pMe->pIImage[SPRITE_DOWNLOADING])
{
IIMAGE_SetParm(pMe->pIImage[SPRITE_DOWNLOADING], IPARM_RATE, 600, 0);
IIMAGE_Start(pMe->pIImage[SPRITE_DOWNLOADING],0,0);
}
break;
case ERROR_EFSFULL:
IIMAGE_Stop(pMe->pIImage[SPRITE_DOWNLOADING]);
if(pMe->nDelay < 15)
{
if(pMe->pIImage[SPRITE_MEMMORY_ERROR])
IIMAGE_Draw(pMe->pIImage[SPRITE_MEMMORY_ERROR],0,0);
pMe->nDelay++;
}
if(pMe->nDelay == 15)
{
ISHELL_CloseApplet(pMe->a.m_pIShell,FALSE);
}
break;
case ERROR_WEB_READ:
IIMAGE_Stop(pMe->pIImage[SPRITE_DOWNLOADING]);
if(pMe->pIImage[SPRITE_NET_ERROR])
IIMAGE_Draw(pMe->pIImage[SPRITE_NET_ERROR], 0, 0);
if(pMe->WebReadCB.pfnCancel)
CALLBACK_Cancel(&pMe->WebReadCB);
if(pMe->ISourceReadCB.pfnCancel)
CALLBACK_Cancel(&pMe->ISourceReadCB);
if(pMe->pIWebResponse)
{
IWEBRESP_Release(pMe->pIWebResponse);
pMe->pIWebResponse = NULL;
}
break;
case DOWNLOADED:
pMe->prevLingerTime = INETMGR_SetLinger (pMe->pINetMgr, pMe->lingerTime2);
if(pMe->num==0)
{
pMe->num1=1;
pMe->num2=1;
pMe->count=0;
pMe->pIFile = IFILEMGR_OpenFile(pMe->pIFileMgr,pMe->pFileName, _OFM_READ);
cnt=0;
if (pMe->pIFile)
{
MEMSET(&fc, 0 , sizeof(fc));
j=0;
while (ReadLine(pMe,pMe->pIFile,&fc, FileBuf, sizeof(FileBuf)) >= 0)
{
char* tab = STRCHR(FileBuf, '\0');
if (tab)
{
AECHAR WideBuf[1400];
const char* DataCopy = STRDUP(FileBuf);
if (DataCopy)
{
*tab = 0;
STR_TO_WSTR(FileBuf, WideBuf, sizeof(WideBuf));
l=STRLEN(FileBuf);
for(i=0;iFileBuf1+i)=*(FileBuf+i);
}
*(pMe->FileBuf1+i)='\0';
for(i=0;iFileBuf2[cnt][i]=*(pMe->FileBuf1+0+i));
}
pMe->FileBuf2[cnt][l]='\0';
}
FREEIF(DataCopy);
DataCopy=NULL;
}
pMe->count++;
cnt++;
j++;
}
if( IFILEMGR_Test(pMe->pIFileMgr, pMe->pFileName) == SUCCESS )
{
// A file exists with that name so delete it.
IFILE_Release(pMe->pIFile);
pMe->pIFile=NULL;
IFILEMGR_Remove(pMe->pIFileMgr, pMe->pFileName);
}
}
if(pMe->num==0)
{
s=0;
while(pMe->FileBuf2[0][s]!='\0')
{
*(pMe->arr1+s)=pMe->FileBuf2[0][s];
s++;
}
*(pMe->arr1+s)='\0';
pMe->num++;
}
pMe->num=0;

if(pMe->num1==1)
{
pMe->num=100;
pMe->pFileName=pMe->arr1;
pMe->pFileName1="gadget.txt";
ConnectToWebsite(pMe, pMe->stURLPath, pMe->pFileName);//gadget.png
// ConnectToWebsite(pMe, pMe->stURLPath, pMe->pFileName1);
}
else
{
if( STRENDS(".txt", pMe->pFileName)==TRUE)
//if((STRCMP(pMe->pFileName,"gadget.txt")==0)|| (STRCMP(pMe->pFileName,"gadget1.txt")==0))
{
IIMAGE_Stop(pMe->pIImage[SPRITE_CONNECTING]);
IIMAGE_Stop(pMe->pIImage[SPRITE_DOWNLOADING]);
if(pMe->pIImage[SPRITE_DOWNLOADING])
IIMAGE_Draw(pMe->pIImage[SPRITE_DOWNLOADING],0,0);
pMe->nPage = ARCHICE_COMIC_PAGEF;
}
else if( STRENDS(".png", pMe->pFileName)==TRUE)
{
if(!(pMe->pIImage[SPRITE_ARCHIE_COMIC]))
pMe->pIImage[SPRITE_ARCHIE_COMIC] = ISHELL_LoadImage(pMe->a.m_pIShell, pMe->pFileName);
if(pMe->pIImage[SPRITE_ARCHIE_COMIC])
{
IIMAGE_SetParm(pMe->pIImage[SPRITE_ARCHIE_COMIC],IPARM_ROP,AEE_RO_TRANSPARENT,0);
IIMAGE_GetInfo(pMe->pIImage[SPRITE_ARCHIE_COMIC],&imageInfo);
pMe->nImageHeight = imageInfo.cy;
}
IIMAGE_Stop(pMe->pIImage[SPRITE_DOWNLOADING]);
if(pMe->pIImage[SPRITE_DOWNLOADING])
IIMAGE_Draw(pMe->pIImage[SPRITE_DOWNLOADING],0,0);
pMe->nPage = ARCHICE_COMIC_PAGE;
}
}
break;
DBGPRINTF("i m in web resp screen");
}