Just a postscript to this discussion: I found that the upload facility in the homepages module works just fine on both binary and text files. It was written by a different person to the portrait upload .tcl file, so I could (rashly) suggest that maybe only one of them knows what they're doing. I'm no Tcl expert, but I'm comparing the upload.tcl files to see what differences they throw up.