Asynchronous drag-and-drop file upload-small instance
Upload.html
<! DOCTYPE html><!--to the license header, choose License Headers in Project properties.to change this template File, choose Tools | Templatesand Open the template in the editor.-->
upload.php
<?phpheader ("Content-type:text/html;charset=utf-8"), if (Is_uploaded_file ($_files[' AA ' [' Tmp_name '])) { Move_uploaded_file ($_files[' AA '] [' tmp_name '], "./". Iconv ("UTF-8", "GBK", $_files[' AA ' [' name '])); echo ' 1 ';}
Xmlhttpreuest.js
function ajaxfunction () {var xmlHttp; try { //Firefox, Opera 8.0+, Safari xmlhttp=new XMLHttpRequest ();
} catch (E) {////Internet Explorer try { xmlhttp=new activexobject ("msxml2.xmlhttp"); } catch (E) { try { xmlhttp=new activexobject ("Microsoft.XMLHTTP"); } catch (E) { alert ("Your browser does not support ajax! "); return false;}} } return xmlHttp;}
The above mentioned is the whole content of this article, I hope you can like.