$result=move_uploaded_file($_FILES['this_file']['tmp_name'],"../uploads/{$_FILES['the_file']['name']}");
if($result){...}
请问,move_uploaded_file,的合法文件如何确定
if($result){...}
请问,move_uploaded_file,的合法文件如何确定
解决方案 »
- 端口已处于监听状态,为什么 fsockopen还会失败
- mktime这个括号里的参数什么意思啊 看不太懂也看手册了
- DZX1.5如何实现相册上传后 自定义封面效果 请看演示图
- PHP发送邮件程序,邮件内容中有表单,用户在表单中输入数据后,就可进行提交,如何做?
- 请教一个函数
- 我开启了LINUX8.0自带的apache+php+mysql,为什么有错?
- 请大家帮我解决一下!!!
- 关于树的问题
- 江湖救急呀!急急急呀!请各位大虾帮帮忙!关于如何用php向指定邮箱发email的问题(一定给高分)
- 平台时不时出的没有权限访问的
- 用plsql可以连接oracle但是用OCILogon连接不上oracle
- 分页显示内容的代码??
else
(。。get)总是跳到get里,如何理解
echo 'ok';
else
echo 'no';
{
/*处理表单,对已经长传的文件进行php处理,存到最终目录
尝试移动上传文件
['the_file'] 表单里file类型的元素,第二个['']可变,在服务器中是临时文件名,在本地计算机里是本地的文件名*/
$result=move_uploaded_file($_FILES['this_file']['tmp_name'],"../uploads/{$_FILES['the_file']['name']}");
if($result)
{
print '<p>Your file has been uploaded.</p>';
}
else//移动出错
{
print '<p style="color:red;">Your file could not be uploaded because:';
switch($_FILES['the_file']['error'])//打印错误类型
{
case 1:
print 'The file exceeds the upload_max_filesize setting in php.ini';
break;
case 2:
print 'The file exceeds the MAX_FILE_SEZE setting in the HTML form';
break;
case 3:
print 'The file was only partially uploaded';
break;
case 4:
print 'No file was uploaded';
break;
case 6:
print ' The timporary folder does not exist.';
default:
print 'Something unforeseem happened.';
break;
}
print '</p>';
}
//print '11';
}
else
{
print '<form action="upload_file.php" enctype="multipart/form-data" method="post" >
<p>Upload a file using this form;</p>
<input type="hidden" name="MAX_FILE_SIZE" value="300000"/>
<P><input type="file" name="the_file"/></P>
<p><input type="submit" name="submit" value="Upload This File"/></p> </form>';
}
注意大小写