Talk about the use of jquery Ajax and PHP implementation of the image upload, the following I introduce the use of PHP Ajax to achieve a variety of files without refreshing upload, directly put an example of hope for the students to help.
Can be added in bulk upload, simple and convenient
| The code is as follows |
Copy Code |
|
up_deal.php
| code as follows |
copy code |
| "!--? php if ((($_files["File1") ["type"] = = "Image/gif") | | ($_files["File1" ["type"] = = "Image/jpeg") | | ($_files["File1" ["type"] = = "Image/bmp") | | ($_files["File1" ["type"] = = "Image/pjpeg")) && ($_files["File1" ["Size"] < 100000)) {//100kb $extend = Explode (".", $_files["File1" ["name"]); $key = count ($extend)-1; $ext = ".". $extend [$key]; $newfile = Time (). $ext; If (!file_exists (' upload ')) {mkdir (' upload ');} Move_uploaded_file ($_files["File1" ["Tmp_name"], "upload/". $newfile); @unlink ($_files[' file1 '); Echo $newfile; }else { echo ' error '; } ? |
http://www.bkjia.com/PHPjc/632906.html www.bkjia.com true http://www.bkjia.com/PHPjc/632906.html techarticle talk about the use of jquery Ajax and PHP implementation of the image upload, the following I introduce the use of PHP Ajax to achieve a variety of files without refreshing upload, directly put an example of hope for the students to help. Can be added in bulk ...