Summary of several methods of asynchronously uploading images in PHP_PHP Tutorial
WBOY
Release: 2016-07-20 11:10:50
Original
1155 people have browsed it
There are two commonly used methods to upload images asynchronously. One is to use iframe, and the other is to use ajax to achieve it. Generally, third-party plug-ins are used.
Upload image form submission target into a hidden iframe,
The code is as follows
Copy code
代码如下
复制代码
form action="upload.php" id="form1" name="form1" enctype="multipart/form-data" method="post" target="uploadIframe">
form action="upload.php" id="form1" name="form1" enctype="multipart/form- data" method="post" target="uploadIframe">
Then the background processes the upload image logic and returns to the front desk. Use ajax to modify the DOM object of the current page to achieve the friendly function of uploading images without refreshing. Example
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn