\Bd_upload

上传/下载公共方法

Summary

Methods
Properties
Constants
random()
fileext()
createDir()
getfilepath()
file_save()
create_thumb_image()
upload_avatar()
favicon_save()
getOSBrowserType()
download()
uploadify_str()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

random()

random(  $length,   $numeric) 

Parameters

$length
$numeric

fileext()

fileext(  $filename) : string

获取文件名后缀

Parameters

$filename

Returns

string

createDir()

createDir(  $path) 

Parameters

$path

getfilepath()

getfilepath(  $custom_path,   $mkdir = false) 

Parameters

$custom_path
$mkdir

file_save()

file_save(  $FILE,   $allowpictype = array(),   $resize_flag = FALSE,   $width,   $height,   $custom_path = '') : array

上传文件

Parameters

$FILE
$allowpictype

允许上传的文件类型

$resize_flag

是否缩放标记

$width

缩放的宽

$height

缩放的高

$custom_path

Returns

array

create_thumb_image()

create_thumb_image(  $path,   $new_filename,   $width,   $height) : string

创建缩略图

Parameters

$path

原图路径

$new_filename

新图名称

$width

$height

Returns

string

upload_avatar()

upload_avatar(  $savepath,   $img,   $types = array(),   $path = '') 

Parameters

$savepath
$img
$types
$path

favicon_save()

favicon_save(  $FILE) 

上传icon图标

Parameters

$FILE

getOSBrowserType()

getOSBrowserType(  $user_agent) : string

得到用户浏览器类型

Parameters

$user_agent

Returns

string

download()

download(  $path,   $name) 

文件下载

Parameters

$path

下载路径

$name

文档名称

uploadify_str()

uploadify_str(String  $file_name, String  $fileTypeExts, String  $div_id, String  $input_id, String  $buttonText, String  $js_input_id, String  $button_id,   $path_flag = '') : string

jquery插件上传字符串

Parameters

String $file_name

服务器端接收的文件域的名字

String $fileTypeExts

可以上传的文件类型,多个用英文;分隔例:.flv;.mp4

String $div_id

显示进度条的div的id

String $input_id

文件域的id

String $buttonText

按钮显示的文字

String $js_input_id

js操作的input的id

String $button_id

表单提交按钮的id

$path_flag

字符串,有值标示不要文件大小和本地文件名,空值有大小和把的文件名

Returns

string —

插件代码