This is a can upload 10 files at the same time Php+ajax no refreshing upload source, and also with the upload progress bar oh, good crap don't say more like to download it.
This is a can upload 10 files at the same time Php+ajax no refreshing upload source, and also with the upload progress bar oh, good crap don't say more like to download it.
<title>No refresh File upload system</title>
file.php File upload php source code.
<title>Untitled Document</title>
$sort = 12;
$f _type=strtolower ("swf,jpg,rar,zip,7z,iso,gif");//Set the type of file that can be uploaded
$file _size_max=200*1024*1024;//limit the maximum capacity of a single file upload
$overwrite = 0;//is allowed to overwrite the same file, 1: Allowed, 0: not allowed
$f _input= "Files";//Set up an upload domain name
foreach ($_files[$f _input]["error"] as $key = = $error) {
$up _error= "No";
if ($error = = UPLOAD_ERR_OK) {
$f _name=$_files[$f _input][' name ' [$key];//get the upload source file name
$uploadfile = $uploaddir. Strtolower (basename ($f _name));
$tmp _type=substr (STRRCHR ($f _name, "."), 1);//Get the file name extension
$tmp _type=strtolower ($tmp _type);
if (!stristr ($f _type, $tmp _type)) {
echo "";
$up _error= "yes";
}
if ($_files[$f _input][' size '] [$key]> $file _size_max) {
echo "";
$up _error= "yes";
}
if (file_exists ($uploadfile) &&! $overwrite) {
echo "";
$up _error= "yes";
}
$string = ' abcdefghijklmnopgrstuvwxyz0123456789 ';
$rand = ";
for ($x =0; $x <12; $x + +)
$rand. = substr ($string, Mt_rand (0,strlen ($string)-1), 1);
$t =date ("Ymdhis"). substr ($gettime [0],2,6). $rand;
$attdir = "./file/";
if (!is_dir ($attdir))
{mkdir ($attdir);}
$uploadfile = $attdir. $t. ".". $tmp _type;
if ($up _error!= "yes") and (Move_uploaded_file ($_files[$f _input][' tmp_name ')
[$key], $uploadfile))) {
$_msg=$_msg. $f _name. ' Upload success n ';
}
else{
$_msg=$_msg. $f _name. ' Upload failed n ';
}
}
}
echo "";
?>
http://www.bkjia.com/PHPjc/445040.html www.bkjia.com true http://www.bkjia.com/PHPjc/445040.html techarticle This is a can upload 10 files at the same time Php+ajax no refreshing upload source, and also with the upload progress bar oh, good crap don't say more like to download it. This is a can ...