Hi all:
I am sorry for my question is not in JSP.
I have use domino go web server and write a CGI program for uploading a file in C++.
but when I upload a file to it , It always get the wrong data size. form example, I
get the length from CONTENT_LENGTH is 238382 or 238336, but I only Can read 1046 bytes
form the STDIN. who can tell me whatcan I do? thanks advance! Following is my reading
founction!
char * GetAllData(unsigned long &lngTotalSize)
{
int len;
char *strAllData;
lngTotalSize = atol(getenv("CONTENT_LENGTH"));
if((strAllData =(char*)malloc(lngTotalSize+1))==NULL)
{
iErrno = E_NOMEMORY;
return NULL;
}
_setmode(_fileno(stdin),_O_BINARY);
unsigned long i=0;
len=read(_fileno(stdin), strAllData, lngTotalSize);
strAllData[len]=0;
lngTotalSize=len;
return strAllData;
}
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets