I've made a patch which fixes the uploading on Windows servers. Firstly I replaced most of
make_dirs with a call to
File::Path::mkpath, which should hopefully be able to deal with all kinds of filesystems when making directories (caveat: I've no idea what it does on UNIX systems, which are the priority). Secondly, I set
binmode on the uploading filehandle for the same reason that it was set in fotoup.pl.
I managed to successfully upload a picture after these changes. However, when I attempted to load the image (which of course also needs to be
binmodeed, but I figured I'd just see if it was in the database first), my Apache process started having spasms and causing protection faults every few seconds, so I've stopped playing with this for a while. I'd be interested to see if anyone else has success.
I'm using Apache 1.3.22 Win32 on my test server with mod_perl/1.26_01-dev dynamically linked. I also have an Apache2 installation with mod_perl 2 on this box which I intend to try out later if I get round to it.
If you don't have patch on your Windows box (I'm guessing this applies to most people) you can just merge the diff by hand as it's not a very complex patch. UNIX users with a death wish might also like to try it to see if
mkpath works for them.
I was going to add
binmode to the output too, but that uses an Apache-wrapped filehandle which I'm not familiar with the semantics of and am not sure what I need to put in binary mode. My Apache crashing constantly means that I cannot easily experiment, but if you want to try the relevant code is right at the bottom of