1
파일을 업로드 할 양식이있는 대화 상자를 표시합니다.jquery로 PHP를 통해 파일을 업로드하려면 어떻게해야합니까?
확인을 클릭하면 선택한 파일이 업로드됩니다.
jquery와 PHP로 어떻게 할 수 있습니까?
코드 :
if(act=='exchangePic')
{
$("#dialog").attr('title','Change picture ').dialog({buttons:{'ok':{class:'btn',text:'Ok',click:function(){
$('#imgHolder_'+picture_id).css({'background-color':''});
$(this).dialog('close');
}}}, show:'fade',hide:'explode',width:'380px',modal:true,closeText:' X '}).html("<form><input type='file' id='newUpload' name='newUpload' class='upfile'/></form>");
}//end of act=='exchangePic'
입니다. @Blueimp.github.com/jQuery-File-Upload/ – Arun
@Arunkumar를 사용해보십시오. 가능합니다. File API를 지원하는 브라우저 만 있으면됩니다. 예 : https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications#Example.3A_Uploading_a_user-selected_file – Quentin
@Arunkumar, XMLHttpRequest v 2.0은 파일을 처리 할 수 있습니다. 원하는 경우 jQuery 양식 플러그인을 사용할 수도 있습니다. 정말 간단합니다. http://malsup.com/jquery/form/ – MahanGM