No Refresh File Upload Press spokesperson's job document news broadcast document a file press release

Source: Internet
Author: User
No refresh file Upload

Ajax Formdata Object completes no-flush operation

The AJAX Level 2 standard can operate on files, but only new browsers (incompatible with the low version of IE), are H5 standard

Precautions:

    1. Form size

    2. Single File Upload size

      Real:

    3. Write a form form, but be aware that the Enctype attribute is not set for form forms

    4. Bind a Click event for the uploaded button, complete the AJAX submission upload file

    5. Use Formdata to collect data from form forms (normal data + upload domain)

    6. To use the onprogress handle of the upload member of an Ajax object to monitor the file upload situation

      1. Set an upload progress bar display box

      b) CSS Settings

      c) Set up monitoring file upload events

    7. To monitor Ajax operations with onReadyStateChange

    8. Send AJAX requests (Note: You do not need to set up an AJAX request header when using Formdata to upload data)

    9. Use the event source (the uploaded file) to make progress display in OnProgress

    10. Server data.php file implementation upload file processing

      IFRAME implementation without flush upload

    11. Create a index.php file, set the upload domain

      Technology point 1: You need to set up a form submission open window an IFRAME defined for itself

      Technical point 2: The data.php file needs to process the resulting picture, then return the image URL address, use top to get the window to open the current IFRAME, modify the src attribute of the IMG tag

      2. data.php to finish saving and returning pictures

The above on the introduction of no-refresh file upload, including file upload, the content of the new text, I hope that the PHP tutorial interested in a friend helpful.

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