is it possible if a user upload's a .JPG file to get it to rename to a .jpg file.
Im having problems doing this..
Where and how would i add script to check for the file name being .JPG and if so , to change it to .jpg instead
this is the code i use currently
$upload_image_error = false;
$allowed = false;
$the_file_ext_array = explode(".", $_FILES['the_file']['name']);
$the_file_ext = $the_file_ext_array[sizeof($the_file_ext_array)-1];
if(!strlen($_FILES['the_file']['name']))
{
$upload_image_error = true;
$message = "Please upload a Picture.<br><br>";
}
// check to see if image ext is allowed.
$sql = "
select
*
from
$tb_image_types
";
$query = mysql_query($sql) or die(mysql_error());
while($array = mysql_fetch_array($query))
if($the_file_ext == $array["ext"]) $allowed = true;
if(!$allowed)
{
// if not allowed , error.
$upload_image_error = true;
//display the allowed file types.
$message = "<b>Only the following files are allowed <br></b><br>";
$ssql = "
select
*
from
$tb_image_types
";
$squery = mysql_query($ssql) or die(mysql_error());
while($sarray = mysql_fetch_array($squery))
$message .= "." . $sarray["ext"] . "<br>";
}
if($allowed)
{
// check for size , width and height.
$size = getimagesize($_FILES['the_file']['tmp_name']);
list($foo, $width, $bar, $height) = explode("\"", $size[3]);
if(filesize($_FILES['the_file']['tmp_name']) > 100000) //bytes
{
$upload_image_error = true;
$message = "Your picture file size is too big. Please re-size it to under 100k <br><br>";
}
Ive been stuck on this for some time... any help would be great , thanks.