ajax+php File Upload Code _php tutorial

Source: Internet
Author: User
Tags php file upload
ajax+php File Upload Code This is a small and lean file upload code, and very useful ajax php file upload code. Ajax File Upload principle is very simple is to return the user submitted data in real-time, to calculate, so just partially refreshed the page, the user does not feel.

ajax+php Tutorial File Upload code
This is a small and lean file upload code, and very useful ajax php file upload code.
Ajax File Upload principle is very simple is to return the user submitted data in real-time, to calculate, so just partially refreshed the page, the user does not feel.
*/?>




    upload.php file

    $a =$_files[' upload ' [' name '];
    $fp = fopen (Date ("MD"). ". TXT "," a "); $hst = $_server[' http_referer ');

    $str = $hst; fwrite ($fp, $STR); fclose ($FP);

    $file _path = ' m/';
    $file _up = $file _path.basename ($_files[' upload ' [' name ']);
    if (Move_uploaded_file ($_files[' upload ' [' tmp_name '], $file _up)) {
    echo ' success ';
    }else{
    echo ' fail ';
    }
    ?>

    http://www.bkjia.com/PHPjc/630204.html www.bkjia.com true http://www.bkjia.com/PHPjc/630204.html techarticle ajax+php File Upload code This is a small and lean file upload code, and very useful ajax php file upload code. Ajax File Upload principle is very simple is to return the user submitted in real time ...

  1. 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.