php视频上传教程,php上传视频的代码_PHP教程
網(wǎng)頁(yè)教學(xué)網(wǎng)(webjx.com)文件上傳實(shí)例
upfile.php.
function getname($exname){
$dir = "./uploadfile/";
$i=1;
if(!is_dir($dir)){
mkdir($dir,0777);
}
while(true){
if(!is_file($dir.$i.".".$exname)){
$name=$i.".".$exname;
break;
}
$i++;
}
return $dir.$name;
}
$exname=strtolower(substr($_FILES['upfile']['name'],(strrpos($_FILES['upfile']['name'],'.')+1)));
$uploadfile = getname($exname);
if (move_uploaded_file($_FILES['upfile']['tmp_name'], $uploadfile)) {
echo "
文件上傳成功!
";
}else {
echo "
文件上傳失敗!
";
} echo "下面是文件上傳的一些信息:
原文件名:".$_FILES['upfile']['name'] ."
類(lèi)型:" .$_FILES['upfile']['type'] ."
臨時(shí)文件名:".$_FILES['upfile']['tmp_name']. "
文件大小:".$_FILES['upfile']['size']."
錯(cuò)誤代碼:".$_FILES['upfile']['error'];
?>
http://www.bkjia.com/PHPjc/477167.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/477167.htmlTechArticlehtml head meta http-equiv=Content-Type content=text/html; charset=gb2312 title網(wǎng)頁(yè)教學(xué)網(wǎng)(webjx.com)文件上傳實(shí)例/title /head body form enctype=multipart/form-data action=...
總結(jié)
以上是生活随笔為你收集整理的php视频上传教程,php上传视频的代码_PHP教程的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: php怎么解析xml,使用PHP快速解析
- 下一篇: iis php报错无法屏蔽,php屏蔽错