2013-05-08 3 views
0

제발 도와주세요!IE에서 이미지 업로드가 작동하지 않습니까?

나는

단지 로딩 GIF와 함께 붙어 아무것도하지 않습니다. 그것은 위의 될 가능성이 얻을 것으로 보인다 :(IE를 제외한 모든 브라우저에서 잘 작동하는 것 같다 이미지 업 로더를했습니다 코드 또는 수는 실제 업로드 페이지에 자바 스크립트를 수?

어떤 제안? ...

<?php 
session_start(); 
include 'resizeimage.php'; 
include '../conf/config.php'; 
$loggedin = $_SESSION['loggedin_user']; 
$getmid = mysql_query("SELECT * FROM members WHERE Username = '$loggedin'"); 
while($iamid = mysql_fetch_array($getmid)) 
{ 
$member_id = $iamid['ID']; 
} 
$path = "../m/members_image/".$member_id."/temp/"; 
$valid_formats = array("jpg", "jepg", "png", "gif", "pjpeg", "pjpg", "PJPEG", "PJPG", "JPG", "JPEG", "PNG", "GIF"); 
$pid = date("Ymdhis"); 
$pid = str_replace(".", "", "$pid"); 
$pid = $member_id; 
/*$_SESSION['pid'] = $pid;*/ 
if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST") { 
$name = $_FILES['photoimg']['name']; 
$size = $_FILES['photoimg']['size']; 
if(strlen($name)) { 
$extarr = explode(".", $name); 
$ext = end($extarr); 
if(in_array($ext,$valid_formats)) { 
if($size<(3000000)) { 
$actual_image_name = $pid.".".$ext; 
$tmp = $_FILES['photoimg']['tmp_name']; 
if(move_uploaded_file($tmp, "$path$actual_image_name")) { 
$imgsrc = "$path$actual_image_name"; 
list($width, $height) = getimagesize($imgsrc); 
$image = new SimpleImage(); 
$image->load($imgsrc); 
if ($width > $height) { $image->resizeToWidth(960); } 
else { $image->resizeToHeight(600); } 
$image->save("$imgsrc"); 
list ($width1, $height1) = getimagesize($imgsrc); 
if ($width1 > 960) { 
$image->resizetoWidth(960); 
$image->save("$imgsrc"); 
} else {} 
if ($height1 > 600) { 
$image->resizetoHeight(600); 
$image->save("$imgsrc"); 
} else {} 
echo "<img class='preview'>"; 
} else { echo "failed"; }; 
} else { echo "Image file size max 3 MB"; } 
} else { echo "Invalid file format.."; } 
} else { echo "Please select image..!"; } 
exit; 
} 
?> 

자바 스크립트 :

<script type="text/javascript" > 

$(document).ready(function() { 

$('#photoimg').live('change', function() { 

    $("#btn_contaier_browse").hide(); 
    $("#preview").html(''); 
    $("#preview").html("<div class='splittermessages'></div><br><table border='0'><tr><td><img width=60 src='/images/loading.gif'></td><td>Uploading image ..</td></tr></table>"); 

    $("#imageform").ajaxForm({ 
     target: '#preview', 
     success: showCrop 

    }).submit(); 
}); 
}); 
function showCrop() { 
$("#btn_contaier_browse").show(); 
$("#tiltusm").html('Make thumbnails.. crop your image'); 
$('#currentElement').attr("src", $('#currentElement').attr("src")); 
$("#currentElement").css("display","block"); 
$('#currentElement').hide(); 
$('#currentElement').fadeIn(500); 

} 
function reloadz() { 

setTimeout(function(){ window.location = '/photos.html';}, 3000); 

} 
</script> 
+0

난 정말 그 실제에 제대로 들여 쓰기를 바란다 출처. 또한 [적절한 SQL 탈출] (http://bobby-tables.com/)이 절실히 필요합니다. – tadman

+0

예, 그렇습니다. 죄송합니다. 왜 여기에 들여 쓰기가 적절하지 않은지 모르시겠습니까? – EdzJohnson

+0

자바 스크립트 코드를 게시 할 수 있습니까? – ROMMEL

답변

0

내가

이 는 다음 코드를 사용하는 모든 JQuery와 파일을 포함 HTML 양식을 jQuery를 사용

HTML

<head> 
$(function() { 
    $('#submitBtn').bind('click', function(e) { 
     $('#myForm').submit(); 
     $('#myFrame').live('change', function(e) { 
      //read iframe and put your own success message 
     }); 
    }); 
}); 
</head> 
<body> 
<form id="myForm" action="myAction.php" enctype="multipart/formdata" target="myFrame"> 
<input id="file" type="file" /> 
<input type="submit" id="submitBtn" /> 
</form> 
<iframe id="myFrame" name="myFrame" ></iframe> 
</body> 
+0

이것은 내가 가진 것입니다 :



' – EdzJohnson

+0

당신이 jQuery를 사용하고 있습니까? –

+0

나는 생각한다. 처음에는 다른 프리랜서 개발자가 코딩했습니다. 나는 확실히있다. 이미지가 호스트에 업로드되지 않아 문제가되지 않는다는 것을 확인할 수 있습니다. 자르기와 함께 보이지 않습니다. – EdzJohnson

관련 문제