2012-09-10 4 views
0

저는 제 문제를 해결하기 위해 열심히 노력했습니다. 나는 구글로드를 보았고 수정을 시도했지만 전혀 운이 없다. (잘 작동하는) Uploadify 내 서버에 내 이미지를 업로드 할 수 있지만, 난 내 데이터베이스 업데이트 클래스에 데이터를 게시 할 수 있도록 다음 숨겨진 필드에 파일 이름을 보내려고숨겨진 필드에 업로드 값을 보내는데 문제가 발생했습니다.

$(function() { 
    $("#listing_pic").uploadify({ 
     height  : 30, 
     swf   : 'uploadify/uploadify.swf', 
     uploader  : 'uploadify/uploadify.php', 
     width   : 120, 
     fileExt  : '*.jpg; *.jpeg; *.JPG; *.JPEG;', 
     checkExisting : 'uploadify/check-exists.php', 
     simUploadLimit: 2, 
     fileSizeLimit : '4MB', 
     auto   : true, 
     multi   : true, 
     onComplete : function(event,queueID,fileObj,response,data) { 
      $('#hiddenlistingpic').val(response); 
     }, 
    }); 
}); 

임. 그것은 저에게 두통을주었습니다. 여기에서

+1

console.log (응답 + 데이터) 할 수 있습니까? – Phil

+0

'uploadify/check-exists.php' 리턴 또는 에코 값은 무엇입니까? – shadyyx

+0

왜 서버 측 업로드 스크립트에서 데이터베이스를 직접 업데이트하지 않는가? – hndr

답변

1

는 :

'onUploadSuccess' : function(file, data, response) { 
     $('#hiddenlistingpic').val(file.name); 
    } 

같은 일이 onuploadcomplete 수행 할 수 있습니다 :

$(function() { 
$("#listing_pic").uploadify({ 
    height  : 30, 
    swf   : 'uploadify/uploadify.swf', 
    uploader  : 'uploadify/uploadify.php', 
    width   : 120, 
    fileExt  : '*.jpg; *.jpeg; *.JPG; *.JPEG;', 
    checkExisting : 'uploadify/check-exists.php', 
    simUploadLimit: 2, 
    fileSizeLimit : '4MB', 
    auto   : true, 
    multi   : true, 
    onComplete : function(event,queueID,fileObj,response,data) { 
     $('#hiddenlistingpic').val(fileObj.name); 
    }, 
}); 
}); 

또는 uploadify 문서에서 https://stackoverflow.com/a/3466188/1253747, 그것을 얻을 수있는 많은 다른 방법이있을 것 같습니다. 또는 내가 누락 된 것이 있습니까?

+0

onUploadSuccess가 필요한 버전이었습니다. 건배 친구, 그것은 간단했다! –

관련 문제