Hi friends,
anyone can help mi how to let the download pic(.gif file) from ftp server to display on the http web broswer. i can only display the “index_html” that i ximport it but i cannot display the download pic.
I using 2 set of RCM3100. 1 set RCM3100 is for ftp server. The 2nd set is the client for download pic from the server. Please Help Mi… Thank…
char buf[8192];
int retval123;
int download_normal(void);
SSPEC_MIMETABLE_START
SSPEC_MIME(“.html”, “text/html”),
SSPEC_MIME(“.gif”, “image/gif”)
SSPEC_MIMETABLE_END
SSPEC_RESOURCETABLE_START
SSPEC_RESOURCE_XMEMFILE(“/index.html”, index_html),
SSPEC_RESOURCE_XMEMFILE(“/rabbit1.gif”, REMOTE_FILE)
SSPEC_RESOURCETABLE_END
main()
{
printf("Calling sock_init()…
");
sock_init();
http_init();
while (ifpending(IF_DEFAULT) == 1) tcp_tick(NULL);
if (!ifstatus(IF_DEFAULT))
{
printf("Network interface failed to come up.
");
exit(2);
}
if (download_normal())
exit(1);
printf("FTP client tests completed.
");
while (1)
{
http_handler();
}
}
int download_normal(void)
{
printf("Calling ftp_client_setup() to download %s…
", REMOTE_FILE);
if(ftp_client_setup(resolve(REMOTE_HOST),REMOTE_PORT,REMOTE_USERNAME,
REMOTE_PASSWORD,FTP_MODE_DOWNLOAD|PASSIVE_FLAG,REMOTE_FILE,
REMOTE_DIR,buf,sizeof(buf))) {
printf("FTP setup failed.
");
exit(2);
}
printf("Looping on ftp_client_tick()...
");
while( 0 == (retval123 = ftp_client_tick()) )
server_tick;
if( 1 == retval123 ) {
printf("FTP download completed successfully. %d bytes.
", ftp_client_filesize());
return 0;
} else {
printf("FTP download failed: status = %d, last code = %d
", retval123, ftp_last_code());
return 1;
}
}