php 常用的文件上传类-可多文件上传

 更新时间:2016年11月25日 15:58  点击:1918

<?php

class My_Lib_upfile{

 var $upfile, $upfile_name, $upfile_size;
 # $upfile 临时文件名 $_FILES['tmp_name'] ,$upfile_name 文件名 $_FILES['name'] ,$upfile_size 文件大小$_FILES['size'];

 var $new_upfile_name;   # 上传后的文件名称 ;
 var $fleth, $fileExtent; # 文件扩展名(类型) ;
 var $f1, $f2, $f3;   # 文件保存路径(多级) upfiles/2008-01/08/;
 var $filename;    # 文件(带路径) ;
 var $filepath; #相对路径用来删除文件;
 var $maxSize, $File_type; # 允许上传文件的大小 允许上传文件的类型 ;

 var $BuildFile,$newFile,$File_width,$File_height,$rate;

 function upfileclass($upfile,$upfile_name,$upfile_size){
        $this->upfile = $upfile;
        $this->upfile_name = $upfile_name;
        $this->upfile_size = $upfile_size;
        $this->new_upfile_name = $this->CreateNewFilename($this->upfile_name);
        $this->f1 = "public/upload/images";
        $this->f2 = $this->f1."/".date('Y')."-".date('m');
        $this->f3 = $this->f2."/".date('d');
        $this->filename = $this->f3 . "/" . $this->new_upfile_name;
        $this->maxSize = 5000*1024;    # 文件大小 5000KB
        $this->File_type = "gif/jpg/jpeg/png/bmp"; # 允许上传的文件类型
 }

 # 创建新文件名 (原文件名)
 function CreateNewFilename($file_name){
    $this->fleth = explode(".",$file_name);
    $this->fileExtent = $this->fleth[(int)count($this->fleth)-1]; # 获取文件后缀;
    $tmps教程tr = date('Ymd').rand(0,time()) . "." .$this->fileExtent;    # 创建新文件名;
    return $tmpstr;
 }

 # 检测文件类型是否正确
 function chk_fileExtent(){
    $iwTrue = 0;
    $fle = explode("/",$this->File_type);
    for($i=0; $i < count($fle); $i++){
     if($this->fileExtent == $fle[$i]){
     $iwTrue = (int) $iwTrue + 1;
     }
    }
    if( $iwTrue == 0 ){
  $this->msg("文件不符合 ".$this->File_type." 格式!");
    }
 }

 # 提示错误信息并终止操作
 function msg($Error){
    echo "<script language="javascript教程"> ";
    echo " alert('".$Error."'); ";
    echo " window.history.back(); ";
    echo "</script> ";
    die();
 }

 # 保存文件
 function savefile(){
    $this->chk_fileExtent();
    $this->chk_fileSize();
    $this->CreateFolder( "./".$this->f1 );
    $this->CreateFolder( "./".$this->f2 );
    $this->CreateFolder( "./".$this->f3 );
    return $this->chk_savefile();
 }

 # 检测上传结果是否成功
 function chk_savefile(){
    $copymsg = copy($this->upfile,"./".$this->filename);
    if( $copymsg ){
   return $this->filename;
    }
    else{
   $this->msg("文件上传失败! 请重新上传! ");
    }
 }

 # 创建文件夹
 function CreateFolder($foldername){
    if( !is_dir($foldername) ){
   mkdir($foldername,0777);
    }
 }

 # 检测文件大小
 function chk_fileSize(){
    if( $this->upfile_size > $this->maxSize ){
  $this->msg("目标文件不能大于". $this->maxSize/1024 ." KB");
    }
 }

 # 删除文件($filePath 文件相对路径)
 function Deletefile($filePath){
    if( !is_file($filePath) ){
   return false;
    }
    else{
   $ending = @unlink($filePath);
   return $ending;
    }
 }

 

}
?>

 
<?php  
 class My_Lib_pages{  
  
   private  $each_disNums;//每页显示的条目数  
   private  $nums;//总条目数  
   var  $current_page;//当前被选中的页  
   private  $sub_pages;//每次显示的页数  
   private  $pageNums;//总页数  
   private  $page_array = array();//用来构造分页的数组  
   private  $subPage_link;//每个分页的链接  
   private  $subPage_type;//显示分页的类型  
    /* 
    __construct是SubPages的构造函数,用来在创建类的时候自动运行. 
    @$each_disNums   每页显示的条目数 
    @nums     总条目数 
    @current_num     当前被选中的页 
    @sub_pages       每次显示的页数 
    @subPage_link    每个分页的链接 
    @subPage_type    显示分页的类型 
  
    当@subPage_type=1的时候为普通分页模式 
    example:   共4523条记录,每页显示10条,当前第1/453页 [首页] [上页] [下页] [尾页] 
    当@subPage_type=2的时候为经典分页样式 
    example:   当前第1/453页 [首页] [上页] 1 2 3 4 5 6 7 8 9 10 [下页] [尾页] 
    */ 
   function __construct($each_disNums,$nums,$current_page,$sub_pages,$subPage_link,$subPage_type){  
    $this->each_disNums=intval($each_disNums);
    $nums = $nums==0 ? 1: $nums;
    $this->nums=intval($nums);
    $this->pageNums=ceil($nums/$each_disNums);
    $this->current_page=intval($current_page);
    $this->current_page=  $this->current_page<=0 ? 1: $this->current_page; 
    $this->current_page= $this->current_page > $this->pageNums ? 1 : $this->current_page;
    $this->sub_pages=intval($sub_pages);  
    $this->subPage_link=$subPage_link;   
    $this->show_SubPages($subPage_type);   
    //echo $this->pageNums."--".$this->sub_pages;  
   }  
  
  
   /* 
  __destruct析构函数,当类不在使用的时候调用,该函数用来释放资源。 
    */ 
   function __destruct(){  
  unset($each_disNums);  
  unset($nums);  
  unset($current_page);  
  unset($sub_pages);  
  unset($pageNums);  
  unset($page_array);  
  unset($subPage_link);  
  unset($subPage_type);  
    }  
  
   /* 
  show_SubPages函数用在构造函数里面。而且用来判断显示什么样子的分页   
    */ 
   function show_SubPages($subPage_type){  
  if($subPage_type == 1){  
  $this->subPageCss1();  
  }elseif ($subPage_type == 2){  
  $this->subPageCss2();  
  }  
    }  
  
  
   /* 
  用来给建立分页的数组初始化的函数。 
    */ 
   function initArray(){  
  for($i=0;$i<$this->sub_pages;$i++){  
  $this->page_array[$i]=$i;  
  }  
  return $this->page_array;  
    }  
  
  
   /* 
  construct_num_Page该函数使用来构造显示的条目 
  即使:[1][2][3][4][5][6][7][8][9][10] 
    */ 
   function construct_num_Page(){  
  if($this->pageNums < $this->sub_pages){  
  $current_array=array();  
   for($i=0;$i<$this->pageNums;$i++){   
   $current_array[$i]=$i+1;  
   }  
  }else{  
  $current_array=$this->initArray();  
   if($this->current_page <= 3){  
    for($i=0;$i<count($current_array);$i++){  
    $current_array[$i]=$i+1;  
    }  
   }elseif ($this->current_page <= $this->pageNums && $this->current_page > $this->pageNums - $this->sub_pages + 1 ){  
    for($i=0;$i<count($current_array);$i++){  
    $current_array[$i]=($this->pageNums)-($this->sub_pages)+1+$i;  
    }  
   }else{  
    for($i=0;$i<count($current_array);$i++){  
    $current_array[$i]=$this->current_page-2+$i;  
    }  
   }  
  }  
   
  return $current_array;  
    }  
  
   /* 
    构造普通模式的分页 
    共4523条记录,每页显示10条,当前第1/453页 [首页] [上页] [下页] [尾页] 
    */ 
   function subPageCss1(){  
    $subPageCss1Str="";  
    $subPageCss1Str.="共".$this->nums."条记录,";  
    $subPageCss1Str.="每页显示".$this->each_disNums."条,";  
    $subPageCss1Str.="当前第".$this->current_page."/".$this->pageNums."页 ";  
  if($this->current_page > 1){  
  $firstPageUrl=$this->subPage_link."1";  
  $prewPageUrl=$this->subPage_link.($this->current_page-1);  
  $subPageCss1Str.="[<a href='$firstPageUrl'>首页</a>] ";  
  $subPageCss1Str.="[<a href='$prewPageUrl'>上一页</a>] ";  
  }else {  
  $subPageCss1Str.="[首页] ";  
  $subPageCss1Str.="[上一页] ";  
  }  
   
  if($this->current_page < $this->pageNums){  
  $lastPageUrl=$this->subPage_link.$this->pageNums;  
  $nextPageUrl=$this->subPage_link.($this->current_page+1);  
  $subPageCss1Str.=" [<a href='$nextPageUrl'>下一页</a>] ";  
  $subPageCss1Str.="[<a href='$lastPageUrl'>尾页</a>] ";  
  }else {  
  $subPageCss1Str.="[下一页] ";  
  $subPageCss1Str.="[尾页] ";  
  }  
   
  return $subPageCss1Str;  
   
    }  
  
  
   /* 
    构造经典模式的分页 
    当前第1/453页 [首页] [上页] 1 2 3 4 5 6 7 8 9 10 [下页] [尾页] 
    */ 
   function subPageCss2(){  
    $subPageCss2Str="";  
    $subPageCss2Str.="当前第<span style=color:red;>".$this->current_page."</span>/".$this->pageNums."页 ";  
   
   
  if($this->current_page > 1){  
  $firstPageUrl=$this->subPage_link."1";  
  $prewPageUrl=$this->subPage_link.($this->current_page-1);  
  $subPageCss2Str.="<a href='$firstPageUrl'>首页</a> ";  
  $subPageCss2Str.="<a href='$prewPageUrl'><<</a>";  
  }else {
  $subPageCss2Str.="<span class=disabled>首页</span>";
  $subPageCss2Str.="<span class=disabled><<</span>";
  }  
   
    $a=$this->construct_num_Page();  
  for($i=0;$i<count($a);$i++){  
  $s=$a[$i];  
   if($s == $this->current_page ){  
   $subPageCss2Str.="<span style='color:red;font-weight:bold;'>".$s."</span>";  
   }else{  
   $url=$this->subPage_link.$s;  
   $subPageCss2Str.="<span class=current><a href='$url'>".$s."</a></span>";  
   }  
  }   
  if($this->current_page < $this->pageNums){  
  $lastPageUrl=$this->subPage_link.$this->pageNums;  
  $nextPageUrl=$this->subPage_link.($this->current_page+1);  
  $subPageCss2Str.=" <a href='$nextPageUrl'>>></a> ";  
  $subPageCss2Str.="<a href='$lastPageUrl'>尾页</a> ";  
  }else {
  $subPageCss2Str.="<span class=disabled>>></span>";
  $subPageCss2Str.="<span class=disabled>尾页</span>";
  }    
  return $subPageCss2Str;  
    }  
 }  
?>  

/*
    函数:生成缩略图
  MakeBuild("images/a.jpg","news/b.jpg","100");
    参数:
    echo $BuildFile;   原图 带路径
    echo $newFile;    生成的缩略图 带路径
    echo $File_width;   缩略图宽度值
    echo $File_height;   缩略图高度值 (默认为宽度的比例值)
    echo $rate;     缩略图象品质;
 */
 function MakeBuild($BuildFile,$newFile,$File_width,$File_height=0,$rate=1000) {
    if(!is_file($BuildFile)){
   $this->msg("文件 ".$BuildFile." 不是一个有效的图形文件! 系统无法生成该文件的缩略图!");
   return false;
    }
    $data = GetImageSize($BuildFile);
    switch($data[2]){
  case 1:
   $im = @ImageCreateFromGIF($BuildFile);
   break;
  case 2:
   $im = @ImageCreateFromJPEG($BuildFile);
   break;
  case 3:
   $im = @ImageCreateFromPNG($BuildFile);
   break;
    }
    if(!$im){
   return false;
    }
    else{
   $srcW = ImageSX($im);  # 取得原图宽度;
   $srcH = ImageSY($im); # 取得原图高度;
   $dstX = 0;
   $dstY = 0;
   
  if($File_height==0){
   $File_height = $File_width/$srcW*$srcH;
  }
   
  if ($srcW*$File_height>$srcH*$File_width){
   $fFile_height = round($srcH*$File_width/$srcW);
   $dstY = floor(($File_height-$fFile_height)/2);
   $fFile_width = $File_width;
  }
  else {
   $fFile_width = round($srcW*$File_height/$srcH);
   $dstX = floor(($File_width-$fFile_width)/2);
   $fFile_height = $File_height;
  }
  $ni = ImageCreateTrueColor($File_width,$File_height);
  $dstX = ($dstX<0)?0:$dstX;
  $dstY = ($dstX<0)?0:$dstY;
  $dstX = ($dstX>($File_width/2))?floor($File_width/2):$dstX;
  $dstY = ($dstY>($File_height/2))?floor($File_height/s):$dstY;
  ImageCopyResized($ni,$im,$dstX,$dstY,0,0,$fFile_width,$fFile_height,$srcW,$srcH);
   
  ImageJpeg($ni,$newFile,$rate); # 生成缩略图;
  imagedestroy($im);     # imagedestroy(resource) 释放image关联的内存
    }
 }

PHP Date / Time 函数
定义和用法
mktime() 函数返回一个日期的 Unix 时间戳。

参数总是表示 GMT 日期,因此 is_dst 对结果没有影响。

参数可以从右到左依次空着,空着的参数会被设为相应的当前 GMT 值。

语法
mktime(hour,minute,second,month,day,year,is_dst)参数 描述
hour 可选。规定小时。
minute 可选。规定分钟。
second 可选。规定秒。
month 可选。规定用数字表示的月。
day 可选。规定天。
year 可选。规定年。在某些系统上,合法值介于 1901 - 2038 之间。不过在 PHP 5 中已经不存在这个限制了。
is_dst 可选。如果时间在日光节约时间(DST)期间,则设置为1,否则设置为0,若未知,则设置为-1。

自 5.1.0 起,is_dst 参数被废弃。因此应该使用新的时区处理特性。
 
提示和注释
注释:在 PHP 5.1 之前,如果该函数的参数非法,则会返回 false。
例子
mktime() 函数对于日期运算和验证非常有用。它可以自动校正越界的输入:

<?php教程
echo(date("M-d-Y",mktime(0,0,0,12,36,2001)));
echo(date("M-d-Y",mktime(0,0,0,14,1,2001)));
echo(date("M-d-Y",mktime(0,0,0,1,1,2001)));
echo(date("M-d-Y",mktime(0,0,0,1,1,99)));
?>输出:

Jan-05-2002
Feb-01-2002
Jan-01-2001
Jan-01-1999


Example #1 mktime() basic example

<?php
// Set the default timezone to use. Available as of PHP 5.1
date_default_timezone_set('UTC');

// Prints: July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));

// Prints something like: 2006-04-05T01:02:03+00:00
echo date('c', mktime(1, 2, 3, 4, 5, 2006));
?>
mktime()是很有用做日期计算和验证,因为它会自动计算出正确的值的范围输入。例如,下面的每一行都会产生字符串“Jan - 01 - 1998”

<?php
echo date("M-d-Y", mktime(0, 0, 0, 12, 32, 1997));
echo date("M-d-Y", mktime(0, 0, 0, 13, 1, 1997));
echo date("M-d-Y", mktime(0, 0, 0, 1, 1, 1998));
echo date("M-d-Y", mktime(0, 0, 0, 1, 1, 98));
?>


<?php
$lastday = mktime(0, 0, 0, 3, 0, 2000);
echo strftime("Last day in Feb 2000 is: %d", $lastday);
$lastday = mktime(0, 0, 0, 4, -31, 2000);
echo strftime("Last day in Feb 2000 is: %d", $lastday);
?>

定义和用法
strftime() 函数根据区域设置格式化本地时间/日期。

语法
strftime(format,timestamp)参数 描述
format 可选。规定如何返回结果。
timestamp 可选。
提示和注释
提示:与 gmstrftime() 的行为相同,不同的是返回时间是本地时间。
例子
输出 strftime() 和 gmstrftime() 的结果:

<?php教程
echo(strftime("%b %d %Y %X", mktime(20,0,0,12,31,98)));
echo(gmstrftime("%b %d %Y %X", mktime(20,0,0,12,31,98)));

//输出当前日期、时间和时区
echo(gmstrftime("It is %a on %b %d, %Y, %X time zone: %Z",time()));
?>输出:

Dec 31 1998 20:00:00
Dec 31 1998 19:00:00
It is Wed on Jan 25, 2006, 11:32:10 time zone: W. Europe Standard Time

format  Description Example returned values
Day --- ---
%a An abbreviated textual representation of the day Sun through Sat
%A A full textual representation of the day Sunday through Saturday
%d Two-digit day of the month (with leading zeros) 01 to 31
%e Day of the month, with a space preceding single digits 1 to 31
%j Day of the year, 3 digits with leading zeros 001 to 366
%u ISO-8601 numeric representation of the day of the week 1 (for Monday) though 7 (for Sunday)
%w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday)
Week --- ---
%U Week number of the given year, starting with the first Sunday as the first week 13 (for the 13th full week of the year)
%V ISO-8601:1988 week number of the given year, starting with the first week of the year with at least 4 weekdays, with

Monday being the start of the week 01 through 53 (where 53 accounts for an overlapping week)
%W A numeric representation of the week of the year, starting with the first Monday as the first week 46 (for the 46th week

of the year beginning with a Monday)
Month --- ---
%b Abbreviated month name, based on the locale Jan through Dec
%B Full month name, based on the locale January through December
%h Abbreviated month name, based on the locale (an alias of %b) Jan through Dec
%m Two digit representation of the month 01 (for January) through 12 (for December)
Year --- ---
%C Two digit representation of the century (year divided by 100, truncated to an integer) 19 for the 20th Century
%g Two digit representation of the year going by ISO-8601:1988 standards (see %V) Example: 09 for the week of January 6, 2009
%G The full four-digit version of %g Example: 2008 for the week of January 3, 2009
%y Two digit representation of the year Example: 09 for 2009, 79 for 1979
%Y Four digit representation for the year Example: 2038
Time --- ---
%H Two digit representation of the hour in 24-hour format 00 through 23
%I Two digit representation of the hour in 12-hour format 01 through 12
%l (lower-case 'L') Hour in 12-hour format, with a space preceeding single digits 1 through 12
%M Two digit representation of the minute 00 through 59
%p UPPER-CASE 'AM' or 'PM' based on the given time Example: AM for 00:31, PM for 22:23
%P lower-case 'am' or 'pm' based on the given time Example: am for 00:31, pm for 22:23
%r Same as "%I:%M:%S %p" Example: 09:34:17 PM for 21:34:17
%R Same as "%H:%M" Example: 00:35 for 12:35 AM, 16:44 for 4:44 PM
%S Two digit representation of the second 00 through 59
%T Same as "%H:%M:%S" Example: 21:34:17 for 09:34:17 PM
%X Preferred time representation based on locale, without the date Example: 03:59:16 or 15:59:16
%z Either the time zone offset from UTC or the abbreviation (depends on operating system) Example: -0500 or EST for Eastern

Time
%Z The time zone offset/abbreviation option NOT given by %z (depends on operating system) Example: -0500 or EST for Eastern

Time
Time and Date Stamps教程 --- ---
%c Preferred date and time stamp based on local Example: Tue Feb 5 00:45:10 2009 for February 4, 2009 at 12:45:10 AM
%D Same as "%m/%d/%y" Example: 02/05/09 for February 5, 2009
%F Same as "%Y-%m-%d" (commonly used in database datestamps) Example: 2009-02-05 for February 5, 2009
%s Unix Epoch Time timestamp (same as the time() function) Example: 305815200 for September 10, 1979 08:40:00 AM
%x Preferred date representation based on locale, without the time Example: 02/05/09 for February 5, 2009
Miscellaneous --- ---
%n A newline character (" ") ---
%t A Tab character (" ") ---
%% A literal percentage character ("%") ---


<?php
/*     December 2002 / January 2003
ISOWk  M   Tu  W   Thu F   Sa  Su
----- ----------------------------
51     16  17  18  19  20  21  22
52     23  24  25  26  27  28  29
1      30  31   1   2   3   4   5
2       6   7   8   9  10  11  12
3      13  14  15  16  17  18  19   */

// Outputs: 12/28/2002 - %V,%G,%Y = 52,2002,2002
echo "12/28/2002 - %V,%G,%Y = " . strftime("%V,%G,%Y", strtotime("12/28/2002")) . " ";

// Outputs: 12/30/2002 - %V,%G,%Y = 1,2003,2002
echo "12/30/2002 - %V,%G,%Y = " . strftime("%V,%G,%Y", strtotime("12/30/2002")) . " ";

// Outputs: 1/3/2003 - %V,%G,%Y = 1,2003,2003
echo "1/3/2003 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/3/2003")) . " ";

// Outputs: 1/10/2003 - %V,%G,%Y = 2,2003,2003
echo "1/10/2003 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/10/2003")) . " ";

 

/*     December 2004 / January 2005
ISOWk  M   Tu  W   Thu F   Sa  Su
----- ----------------------------
51     13  14  15  16  17  18  19
52     20  21  22  23  24  25  26
53     27  28  29  30  31   1   2
1       3   4   5   6   7   8   9
2      10  11  12  13  14  15  16   */

// Outputs: 12/23/2004 - %V,%G,%Y = 52,2004,2004
echo "12/23/2004 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("12/23/2004")) . " ";

// Outputs: 12/31/2004 - %V,%G,%Y = 53,2004,2004
echo "12/31/2004 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("12/31/2004")) . " ";

// Outputs: 1/2/2005 - %V,%G,%Y = 53,2004,2005
echo "1/2/2005 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/2/2005")) . " ";

// Outputs: 1/3/2005 - %V,%G,%Y = 1,2005,2005
echo "1/3/2005 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/3/2005")) . " ";

?>
]
获取指定日期的unix时间戳 strtotime("2009-1-22") 示例如下:
echo strtotime("2009-1-22")  结果:1232553600
说明:返回2009年1月22日0点0分0秒时间戳

二,获取英文文本日期时间 示例如下:
便于比较,使用date将当时间戳与指定时间戳转换成系统时间

(1)打印明天此时的时间戳strtotime("+1 day")
当前时间:echo date("Y-m-d H:i:s",time()) 结果:2009-01-22 09:40:25
指定时间:echo date("Y-m-d H:i:s",strtotime("+1 day")) 结果:2009-01-23 09:40:25

(2)打印昨天此时的时间戳strtotime("-1 day")
当前时间:echo date("Y-m-d H:i:s",time()) 结果:2009-01-22 09:40:25
指定时间:echo date("Y-m-d H:i:s",strtotime("-1 day")) 结果:2009-01-21 09:40:25

(3)打印下个星期此时的时间戳strtotime("+1 week")
当前时间:echo date("Y-m-d H:i:s",time()) 结果:2009-01-22 09:40:25
指定时间:echo date("Y-m-d H:i:s",strtotime("+1 week")) 结果:2009-01-29 09:40:25

(4)打印上个星期此时的时间戳strtotime("-1 week")
当前时间:echo date("Y-m-d H:i:s",time()) 结果:2009-01-22 09:40:25
指定时间:echo date("Y-m-d H:i:s",strtotime("-1 week")) 结果:2009-01-15 09:40:25

(5)打印指定下星期几的时间戳strtotime("next Thursday")
当前时间:echo date("Y-m-d H:i:s",time()) 结果:2009-01-22 09:40:25
指定时间:echo date("Y-m-d H:i:s",strtotime("next Thursday")) 结果:2009-01-29 00:00:00

(6)打印指定上星期几的时间戳strtotime("last Thursday")
当前时间:echo date("Y-m-d H:i:s",time()) 结果:2009-01-22 09:40:25
指定时间:echo date("Y-m-d H:i:s",strtotime("last Thursday")) 结果:2009-01-15 00:00:00

[!--infotagslink--]

相关文章

  • Php文件上传类class.upload.php用法示例

    本文章来人大家介绍一个php文件上传类的使用方法,期望此实例对各位php入门者会有不小帮助哦。 简介 Class.upload.php是用于管理上传文件的php文件上传类, 它可以帮...2016-11-25
  • PHP文件上传一些小收获

    又码了一个周末的代码,这次在做一些关于文件上传的东西。(PHP UPLOAD)小有收获项目是一个BT种子列表,用户有权限上传自己的种子,然后配合BT TRACK服务器把种子的信息写出来...2016-11-25
  • jQuery实现简单的文件上传进度条效果

    本文实例讲述了jQuery实现文件上传进度条效果的代码。分享给大家供大家参考。具体如下: 运行效果截图如下:具体代码如下:<!DOCTYPE html><html><head><meta charset="utf-8"><title>upload</title><link rel="stylesheet...2015-11-24
  • php文件上传你必须知道的几点

    本篇文章主要说明的是与php文件上传的相关配置的知识点。PHP文件上传功能配置主要涉及php.ini配置文件中的upload_tmp_dir、upload_max_filesize、post_max_size等选项,下面一一说明。打开php.ini配置文件找到File Upl...2015-10-21
  • 借助FileReader实现将文件编码为Base64后通过AJAX上传

    这篇文章主要介绍了借助FileReader实现将文件编码为Base64后通过AJAX上传的方法,包括后端对文件数据解码并保存的PHP代码,需要的朋友可以参考下...2015-12-25
  • js实现上传文件添加和删除文件选择框

    这篇文章主要为大家详细介绍了js实现上传文件添加和删除文件选择框 ,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2016-10-25
  • jQuery+ajax简单实现文件上传的方法

    这篇文章主要介绍了jQuery+ajax简单实现文件上传的方法,结合实例形式简单分析了jQuery基于ajax的post方法进行文件传输及asp.net后台处理技巧,需要的朋友可以参考下...2016-06-12
  • 适用于初学者的简易PHP文件上传类

    本文实例讲述了PHP多文件上传类,分享给大家供大家参考。具体如下:<&#63;phpclass Test_Upload{ protected $_uploaded = array(); protected $_destination; protected $_max = 1024000; protected $_messages =...2015-10-30
  • js 实现文件上传样式详情

    这篇文章主要介绍了js 实现文件上传样式,下面文章举例说明js 是如何实现文件上传样式的,附有代码详细解说,需要的朋友可以参考一下,希望对你有所帮助...2021-10-21
  • PHP利用APC模块实现大文件上传进度条的方法

    php 大文件带进度的上传,一直是一个令php程序员很苦恼的问题。查询baidu 、Google ,大体做带进度的上传方式为:flash+php,socket,apc+php等,下面我介绍了apc +php+ajax制作的带进度的上传,并贴出源码,希望对大家有用。 Altern...2015-10-30
  • C#文件上传的简单实现

    这篇文章主要为大家详细介绍了C#文件上传的简单实现,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2020-06-25
  • php需登录的文件上传管理系统

    本文给大家介绍一个不错的需要登录的php 文件上传管理系统,功能简单有需要了解的同学可参考。 代码如下<&#63;php$admin_pw="admin";//管理密码$uploaddir="upload";//上传目录session_start();if($_GET['action']=="g...2015-10-30
  • asp.net html控件的File控件实现多文件上传实例分享

    asp.net中html控件的File控件实现多文件上传简单实例,开发工具vs2010使用c#语言,感兴趣的朋友可以了解下,必定是多文件上传值得学习,或许本文所提供的知识点对你有所帮助...2021-09-22
  • TypeScript前端上传文件到MinIO示例详解

    这篇文章主要为大家介绍了TypeScript前端上传文件到MinIO示例详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪...2022-10-12
  • JQuery异步提交表单与文件上传功能示例

    这篇文章主要介绍了JQuery异步提交表单与文件上传功能,结合实例形式分析了jQuery表单提交及文件传输操作的相关实现技巧,需要的朋友可以参考下...2017-01-16
  • PHP文件上传主要代码讲解

    复制代码 代码如下:<?php if($_FILES['myfile']['name'] != '') { if($_FILES['myfile']['error'] > 0) { echo "错误状态:" . $_FILES['myfile']['error']; } else { move_uploaded_f...2013-10-04
  • 使用jQuery.form.js/springmvc框架实现文件上传功能

    这篇文章主要介绍了使用jQuery.form.jsspringmvc框架实现文件上传功能,非常具有参考借鉴价值,感兴趣的朋友一起学习吧...2016-05-14
  • jquery插件uploadify实现带进度条的文件批量上传

    这篇文章主要介绍了jquery插件uploadify实现带进度条的文件批量上传,感兴趣的小伙伴们可以参考一下...2015-12-14
  • C#简单实现文件上传功能

    这篇文章主要介绍了C#简单实现文件上传功能,利用MVC+EF+LigerUI 实现的upload上传功能,感兴趣的小伙伴们可以参考一下...2020-06-25
  • CKEditor配置实现文件上传功能

    CKEditor是新一代的FCKeditor,是一个重新开发的版本。CKEditor是全球最优秀的网页在线文字编辑器之一,因其惊人的性能与可扩展性而广泛的被运用于各大网站。而CKFinder是...2016-09-20