Hi,

> Your HTML form looks OK.

All right.

> Have you tried printing out the characters as they're
> received, to see if the file is being properly encoded as
> text? It should consist of printable ASCII characters a-z,
> A-Z, 0-9 plus some symbols like % and +.

See yourself the little loop below: am I not printing the characters
as they are received?

==================================
  i = 0;
  c = getchar();
  while(!feof(stdin))
  {
    s_content[i] = c;
    c = getchar();
    printf("%c", c);
    i++;
  }
==================================

As for the characters printed, there are not only 
"ASCII characters a-z, A-Z, 0-9 plus some symbols 
like % and +", there are all sorts of characters 
printed:
- characters coming from the extended ASCII 
  character table like ÿ, Ô, ¢, etc.,
- white question marks inside little black lozenges,
- and also things like 00 in little squares.
                             02
(Tell me what they are really if you know... !)


> Try uploading a simple text file and see if that works.

I have exactly the same problem with a simple text file
containing only a string like: "the sky is blue".
The number of characters read on "stdin" is less than the
"CONTENT_LENGTH" environment variable value.


> Another possibility is that there may be some issues to do
> with signed or unsigned chars.

What do you suggest in relation to my c-cgi code?


Thank you very much for your help.
See you.

--
Léa
-- 
View this message in context: 
http://www.nabble.com/c-cgi-script---html-file-uploading-tp19780000p19797334.html
Sent from the C-prog mailing list archive at Nabble.com.

Reply via email to