topical media & game development
lib-ch-example-ref-cgi-binaryRead.cgi / cgi
#!/bin/ch
/* Copyright (c) 2001 by SoftIntegration, Inc. All Rights Reserved */
include <cgi.h>
int main() {
class CResponse Response;
class CRequest Request;
int total;
size_t countToRead;
Response.begin();
Response.title("Test of Request.binaryRead and Request.getTotalBytes");
printf("<H1> Test of Request.binaryRead and Request.getTotalBytes</H1>
\n");
total = Request.getTotalBytes();
printf("The result of Request.getTotalBytes is : \%d <p>\n", total);
// countToRead = total;
// printf("The raw data is : \%s <p>\n", Request.binaryRead(&countToRead));
countToRead = 4;
printf("To read \%d bytes data.<br>\n", countToRead);
printf("The raw data is : \%s <br>\n", Request.binaryRead(&countToRead));
printf("The actually read bytes is : \%d <p>\n", countToRead);
countToRead = 5;
printf("To read \%d bytes data. <br>\n", countToRead);
printf("The raw data is : \%s <br>\n", Request.binaryRead(&countToRead));
printf("The actually read bytes is : \%d <p>\n", countToRead);
countToRead = 50;
printf("To read \%d bytes data. <br>\n", countToRead);
printf("The raw data is : \%s <br>\n", Request.binaryRead(&countToRead));
printf("The actually read bytes is : \%d <p>\n", countToRead);
Response.end();
}
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.