Asynchronous drag and drop upload file--Small instances
Upload.html
<!
DOCTYPE Html> <!--to the change this license header, choose License Headers in Project Properties. To change this template file, choose Tools |
Templates and open the template in the editor.
-->
upload.php
Copy Code code as follows:
<?php
Header ("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 entire content of this article, I hope you can enjoy.