I looked at the html and nothing obvious shows. Everything looks good. Here is the Code that deals with the Uploaded files. Maybe there is something in it that I missed. I ususally work through the issue, but this one has me baffled!
**********************************************
Upload Code:
//Start file upload script
$u = 0;
foreach($HTTP_POST_FILES as $file_name => $file_array){
if (empty($file_array['name'])){
$load .="";
}else{ //If there is a file
$load .="<br>\n";
$load .="Name:".$file_array['name']."<br>\n";
$load .="Type:".$file_array['type']."<br>\n";
$load .="Size:".$file_array['size']." bytes<br>\n\n";
$name = $file_array['name'];
}
//Test to make sure that uploaded file is of proper format and copy to specified directory if true.
if (is_uploaded_file( $file_array['tmp_name']) && ( $file_array['type'] == "image/pjpeg"
|| $file_array['type'] == "image/gif"
|| $file_array['type'] == "image/x-png"
|| $file_array['type'] == "application/x-shockwave-flash"
|| $file_array['type'] == "video/avi"
|| $file_array['type'] == "video/quicktime"
|| $file_array['type'] == "image/bmp")){
move_uploaded_file($file_array['tmp_name'], "$file_dir/$name") or die("Could not copy file");
}
$photo[$u] = $file_array['name'];
//print $photo[$u];
$u++; //Increment the counter.
**********************************************
Write to database Section
//Query the database and insert values.
$sql3 = "INSERT INTO prop
(memb, webs, add1, city, st, zip, bdrm, bath, cnty, cost, dep, avbl, term, desrpt, drtns, disclaim, amty, school, photo1, photo2, photo3, photo4, photo5, photo6, fpln, type)
VALUES ('$usr_id','$webs','$add1','$city','$st', '$zip','$bdrm','$bath','$cnty','$cost','$dep','$av bl', '$term', '$desrpt', '$drtns', '$disclaim', '$amtys', '$schools', '$photo1', '$photo2', '$photo3', '$photo4','$photo5', '$photo6', '$fpln', '$type')";
$rs3 = mysql_query($sql3, $dbh)
or die(mysql_error());
$pass_id = mysql_insert_id();
}
***********************************************
Write to Directory section
$the_file = $directory.$img_name;
$last_file = file($the_file);
//Change to appropriate left section.
if($bnft or $investor or $hs_srch){
$content .= ' ';
}elseif(!$bnft or !$investor or!$hs_srch){
$content .= '
<div align="center"><img src='.$the_file.' alt="pic_1"></div><br>
<div align="center"><a href="#" target="_top">Additional Photos</a> <a href="#" target="_top">Floor Plan</a> <a href="#" target="_top">Virtual Tour</a></div>
<br>
<div align="center" class="pic_num">Property '.$num.' of '.$prop_num.'</div><br>
';
}
closedir($dp);
***********************************************
I have spaces in the names of other values in the tables and they work well. It's only the name of the uploaded file that gives me trouble!