Hi.

Got a curly one. I have Apache 1.3.x on WIndows XP with PHP 4 and MySQL, etc.

I have two virtual websites configured in Apache. They work fine in all respects except this.

Both sites have the exact same code for handling image uploads via form posts using multipart/form-data as per the instruction manual.

ONE site uploads files just fine and the other does not!

The one that fails does so because the temporary upload file doesn't make it past PHP to the system temp folder (C:\temp). That is: move_uploaded_file cannot move the file because it's not there. The $_FILES['userfile']['tmp_name'] variable does have a valid temp. file name in it in both cases too. The file simply doesn't get there.

php.ini specifies "C:\temp" (tried "C:/temp" also). Both of these WORK for the one site without a problem.

What on earth could be going on? How can PHP accept a multipart/form-data POST for one site and not another when in all cases the temp file goes to the same place?!

I'm not running safe mode or suexec or anything abnormal. I considered file security settings and gave the C:\temp folder an Everyone user and Full control. But Apache on Windows, to my knowledge, doesn't care about any of that stuff anyhow. In any case -- it did not fix the problem.

For the life of me -- I just can't see anything that would change just because the upload URL has a different domain name in it. The PHP tmp dir is, and can only be, still the same! But SOMETHING is different since it's not working. 😐

Thanks for any light you might be able to shed on this for me.

    Write a Reply...