David Hamill wrote: > Your HTML form looks OK. > > 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 +. > > Try uploading a simple text file and see if that works. > > Another possibility is that there may be some issues to do > with signed or unsigned chars. > > David
My two cents: While the OP really shouldn't be writing CGI scripts in C (PHP for web server programming, C++ for client-side apps.), multipart/form-data comes into the web server as MIME-encoded data. All variables, including file data, may (and almost always do) have additional encodings applied (e.g. file upload fields tend to be Base64 encoded but they could also be BinHex encoded or Quoted Printable encoded or...). Basically, the OP needs to write a MIME parser and a decoder for the various encodings out there (or find a library that does the heavy-lifting). -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
