js+php implement asynchronous drag and drop upload file

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.