js+php implement asynchronous drag and drop upload file _javascript tips

Source: Internet
Author: User

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.

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.