Uploaded image not found


#1

I created and tested a site locally and everything was working fine. When I moved my files over to Dreamhost the first problem I have is that the uploaded file (image) can’t be found. The code I am using states with a simple file selection and form posting.

The problem is this:

  1. The file was not uploaded to the correct folder
  2. The test echo code I entered shows that the upload file is not found ( ie, no name when you check for $_FILES[‘Submit_Images’][‘name’] , [‘type’] etc.

Then the following code is setup to check names, file type etc.

(passwords, username, etc were replaced for obvious reasons)

<?php if ($_POST['Submit_Images']) { $connect = mysql_connect("mysql.website.com","My_user_name","My_Password") or die("Connection Failed"); // echo ' connection was completed
'; mysql_select_db("My_database") or die("database does not exist"); // echo ' database connection was completed
'; if ($_FILES['Sub_mitImages']['error'] > 0) { echo 'Problem: '; switch ($_FILES['Submit_Images']['error']) { case 1: echo 'File exceeded upload_max_filesize'; break; case 2: echo 'File exceeded max_file_size'; break; case 3: echo 'File only partially uploaded'; break; case 4: echo 'No File uploaded'; break; case 6: echo 'Cannot upload file: No temp directory specified'; break; case 7: echo 'Upload failed: Cannot write to disk'; break; } } else { echo 'Upload: ' . $_FILES['Submit_Images']['name'] . '
'; echo 'Type: ' . $_FILES['Submit_Images']['type'] . '
'; echo 'Size: ' . ($_FILES['Submit_Images']['size'] / 1024) . ' Kb
'; echo 'Stored in: ' . $_FILES['Submit_Images']['tmp_name']. '
'; } $FixImage = $_FILES['Submit_Images']['name']; echo' The Image name starts as '.$FixImage.'
'; $FixImage = trim($FixImage," "); $FixImage = trim($FixImage,"_"); $FixImage = str_replace("#","No",$FixImage); $FixImage = str_replace("$","Dollar",$FixImage); $FixImage = str_replace("%","Percent",$FixImage); $FixImage = str_replace("^","",$FixImage); $FixImage = str_replace("&","and",$FixImage); $FixImage = str_replace("*","",$FixImage); $FixImage = str_replace("?","",$FixImage); $FixImage = str_replace(" ","_",$FixImage); $FixImage = str_replace("/","",$FixImage); $FixImage = str_replace("|","",$FixImage); $FixImage = str_replace("{","",$FixImage); $FixImage = str_replace("}","",$FixImage); $FixImage = str_replace("[","",$FixImage); $FixImage = str_replace("]","",$FixImage); $FixImage = str_replace("=","",$FixImage); $FixImage = str_replace("+","",$FixImage); $FixImage = str_replace("!","",$FixImage); $FixImage = str_replace("(","",$FixImage); $FixImage = str_replace(")","",$FixImage); $FixImage = str_replace("<","",$FixImage); $FixImage = str_replace(">","",$FixImage); $FixImage = str_replace(",","",$FixImage); $FixImage = str_replace(":","",$FixImage); $FixImage = str_replace("`","",$FixImage); $FixImage = str_replace(";","",$FixImage); $FixImage = str_replace("'","",$FixImage); $FixImage = str_replace("~","",$FixImage); $FixImage = $F_N.'_'.$L_N.'_'.$FixImage; echo ' The New Image name is '.$FixImage.'
'; $write = mysql_query("INSERT INTO My_database VALUES ('A few variable names)"); $ImagePath = './Images.'; if (($_FILES['Submit_Images']['type'] == 'image/gif') || ($_FILES['Submit_Images']['type'] == 'image/jpeg') || ($_FILES['Submit_Images']['type'] == 'image/jpg') || ($_FILES['Submit_Images']['type'] == 'image/png') || ($_FILES['Submit_Images']['type'] == 'image/tiff') || ($_FILES['Submit_Images']['type'] == 'image/tif')) { move_uploaded_file($_FILES['Submit_Images']['tmp_name'],'$ImagePath'/'.$FixImage.'); } else { echo 'Files must be either a JPEG, GIF, PNG, or TIF to be downloaded'; } mysql_close($connect); } ?>

I have loaded a custom editable php.ini file (brought up in one of the forms here) and tried setting the tmp location for file uploads with no positive results. If anyone can provide other checks I can do or knows what is wrong, please let me know.