View Single Post
Old Jul 13th, 2004, 11:51 AM   #1
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
I have been trying to get a script to work that lets the user upload a picture through an html form. Coding it is the easy part.....for some reason, that i can't explain why file uploads (through an html form) won't work on my server. I tryed fooling around with the php.ini file and httpd.conf file. Nothing i've tryed has seemed to work. I have noticed one thing: The var $HTTP_POST_FILES and $_FILES (there really the same thing.) arn't getting set. I am thinking that the file isn't getting uploaded to the server tmp dir. here's the code that i am using:

 $file = $_FILES['testfile']['tmp_name'];
 $path = "/usr/local/web/";
 $dest = "";
 $size = getimagesize($file);
 echo $file . "<-- The File On The System!<br>";
 echo $size . "<-- The Size!<br>";
 switch ($size)
 {
 * * * * * *case 0:
 * * * * * * * * * * * *echo "Image is unknowen";
 * * * * * * * * * * * *break;
 * * * * * * *case 1:
 * * * * * * * * * * * *echo "Images is a GIF";
 * * * * * * * * * * * *$dest = $path.uniqid('img').'gif';
 * * * * * * * * * * * * *break;
 * * * * * * *case 2:
 * * * * * * * * * * * *echo "Image is a JPG";
 * * * * * * * * * * * *$dest = $path.uniqid('img').'gif';
 * * * * * * * * * * * *break;
 * * * * * * *case 3:
 * * * * * * * * * * * * *echo "Image is a PNG";
 * * * * * * * * * * * * *$dest = $path.uniqid('img').'gif';
 * ** * * * * * * * * * * *break;
 * }
* *if ($dest != "")
* *{
* * * * * * * *if (move_uploaded_file($file, $dest))
 * * * * * * *{
     * * * * * * * *echo "File moved.";
 * * * * * * *}
 * * * * * * *else
 * * * * * * *{
 * * * * * * * * * * * *echo "Could not move the file.";
 * * * * * * *}
* * *}

Anyways, the part where i echo the file names and shit at the top only outputs the text that i apended to it, nothing else. Anyways, does anybody here have a clue to what's going on? I think the whole problem is to do with apache and slackware, but i am not sure. Thanks for the help in advance.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote