Aaaaaaargh - Important message for Windows users.
14 hours spent, coding, recoding, trying alternate syntaxes, proofreading looking for misplaced something or other, testing with echo statements...
all the data was correct, all the syntaxes were correct, everything was as it should be ... Finally, I decided to look over the PHP.ini file - over and over again. Nothing.
I hesitated to post to the forums. Uploading images shouldn't be that hard. There was something simple I was overlooking.
16kb files were registering as 88 bytes, and of course not showing at all. I even printed out the image files, original and from the server to compare. The ones coming off the server, even though they were actually the proper size before writing over, were definitely shorter.
So, I looked for some settings I might have missed, in PHP.ini, or perhaps in the encoding for the page/form, or maybe even the way the file system is handled or the way data is sent by different machines or browsers. I had already checked all these ten times... I chose all the universal methods for every command or argument (no wonder programmers are so angry - everything is aggressively termed "Command", "Argument", "Attack", "Execute" - one would almost thing that programming manuals were written by Klingons)...
Anyway - I checked every angle, over and over again...
Except: I was working on a windows system, and forgot to replace $file = fopen($binFile, "r"); with $file = fopen($binFile, "rb"); stupid #%@$# 'rb'.
"On systems which differentiate between binary and text files (i.e. Windows) the file must be opened with 'b' included in fopen() mode parameter"
Ever notice how everything is always in the last place you look?
Should anyone really be expected to see this one character, in a book that is 510 pages, and take notice of it???
