DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19339>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19339 stdin on CGI opened in text mode Summary: stdin on CGI opened in text mode Product: Apache httpd-1.3 Version: 1.3.23 Platform: PC OS/Version: Windows 9x Status: NEW Severity: Normal Priority: Other Component: mod_cgi AssignedTo: [email protected] ReportedBy: [EMAIL PROTECTED] Hi... The default mode for stdin in a VC++ 5.0 C cgi-bin executable is TEXT. On a <form> with type=multipart/form-data this results in the 0x0D 0x0A character sequences being mapped to one character only. As result the following code doesn't work. The CONTENT_LENGTH is off from the actual number read by the number of 0x0D 0x0A pairs that have been converted. Is there a server based solution for this? Cheers. Andrew Walduck char* content_length_string; content_length_string = getenv("CONTENT_LENGTH"); if(content_length_string != 0) { size_t content_length; content_length = strtoul(content_length_string, 0, 10); if(content_length != 0) { FILE* fp; char* buffer; fp = fopen("C:/tmp/CONTENT.txt", "wb"); buffer = (char*) malloc(content_length); if(buffer != 0) { fread(buffer, 1, content_length, stdin); fwrite(buffer, 1, content_length, fp); } fclose(fp); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
