To implement a non-flush file upload we have a false image of the practice is to use the IFRAME framework for file upload, the other is the use of AJAX implementation of file upload, both methods can be achieved without refreshing file upload function.
One of the most primitive and simplest examples of IFRAME uploads:
Front desk upload page index.html, mainly a form with a JS callback function. When uploading a file, the method, Enctype property of the form form must be the same as the following code. Then set the value of target to the name of the IFRAME, so that no flush upload file can be implemented.
| The code is as follows |
Copy Code |
|
Uploading files
|
Background upload processing page uploadfile.php, this code for simple upload code, no error and exception handling. After the upload code execution, to tell the parent page has been uploaded, so, in this page called the parent page callback function callbackfunction, this function can have parameters, form their own definition.
| The code is as follows |
Copy Code |
|
Set_time_limit (0);
if ($_server[' Request_method ']== ' POST ') {
Move_uploaded_file ($_files["Test_file" ["Tmp_name"],
DirName ($_server[' script_filename '). " /uploadtemp/". $_files["Test_file" ["name"]);
echo "";
}
?> |
The above is the use of an IFRAME to implement a non-flush upload file simple method, want a robust program needs to be refined
http://www.bkjia.com/PHPjc/629900.html www.bkjia.com true http://www.bkjia.com/PHPjc/629900.html techarticle to implement a non-flush file upload we have a false image of the practice is to use the IFRAME framework for file upload, the other is the use of AJAX implementation of file upload, both methods can be achieved ...