Input type file problem
Hej eksperten,Jeg har et problem med min upload billede funktion. Den fungere som den skal i Chrome og Firefox på både OSX og WIN, men i IE virker den ikke. Nogle der kan fortælle mig hvorfor?
P.S Jeg ved ikke om det er det rigtige forum jeg skriver dette i ?
<div style="margin-left: 205px;">
<p style="font-size: 9px; margin-left: 2px;">Optimal billedstørrelse: 182x137 (*.jpg)</p>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" id="something" class="uniForm">
<input style="margin-right: 230px;" name="new_image" id="new_image" type="file" class="fileUpload" />
<button name="sbumit" type="sbumit" class="submitButton knap">Upload billede</button>
</form>
<?php
$firma =$_SESSION['firma'];
$newfilename = "$firma.jpg";
if(isset($_POST['sbumit'])){
if (isset ($_FILES['new_image'])){
$imagename = $newfilename;
$source = $_FILES['new_image']['tmp_name'];
$target = "firmapic/".$imagename;
move_uploaded_file($source, $target);
$imagepath = $imagename;
$save = "firmapic/" . $imagepath; //This is the new file you saving
$file = "firmapic/" . $imagepath; //This is the original file
list($width, $height) = getimagesize($file);
$modwidth = 175;
$diff = $width / $modwidth;
$modheight = 100;
$tn = imagecreatetruecolor($modwidth, $modheight) ;
$image = imagecreatefromjpeg($file) ;
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ;
imagejpeg($tn, $save, 100) ;
$save = "firmapic/sml_" . $imagepath; //This is the new file you saving
$file = "firmapic/" . $imagepath; //This is the original file
list($width, $height) = getimagesize($file) ;
$modwidth = 175;
$diff = $width / $modwidth;
$modheight = 100;
$tn = imagecreatetruecolor($modwidth, $modheight) ;
$image = imagecreatefromjpeg($file) ;
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ;
imagejpeg($tn, $save, 100) ;
echo "<b>Billedet er sucessfuldt uploadet til din profil</b>";
}
}
?>
</div>