PHP using Dropzonejs Drag file upload, how to echo the processing results to the current page of the textarea?

Source: Internet
Author: User
Modified the next Dropzonejs of the demo upload page: (Original address: Http://www.dropzonejs.com/exa ... Add a textarea, want to implement the file upload processing completed after the processing results back to the textarea, how to deal with it?

The following is the contents of the index.php file:


  
   Dropzone simple example
  
   
  
   

This is the most minimal example of Dropzone. The upload in this example doesn't work, because there is no actual server to handle the file upload.

The following is the contents of the upload_file.php file:


  
    0) {      echo "Error: " . $_FILES["file"]["error"] . "
"; } else { echo "Upload: " . $_FILES["file"]["name"] . "
"; echo "Type: " . $_FILES["file"]["type"] . "
"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; $content = file_get_contents($_FILES["file"]["tmp_name"]); echo $content; }?>

Reply content:

Modified the next Dropzonejs of the demo upload page: (Original address: Http://www.dropzonejs.com/exa ... Add a textarea, want to implement the file upload processing completed after the processing results back to the textarea, how to deal with it?

The following is the contents of the index.php file:


  
   Dropzone simple example
  
   
  
   

This is the most minimal example of Dropzone. The upload in this example doesn't work, because there is no actual server to handle the file upload.

The following is the contents of the upload_file.php file:


  
    0) {      echo "Error: " . $_FILES["file"]["error"] . "
"; } else { echo "Upload: " . $_FILES["file"]["name"] . "
"; echo "Type: " . $_FILES["file"]["type"] . "
"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; $content = file_get_contents($_FILES["file"]["tmp_name"]); echo $content; }?>

The uploaded image address can be obtained via Ajax and then displayed

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