duanmei1850 2013-09-07 05:48
浏览 52

PHP错误..相同的代码用于工作一个月之前,现在它显示错误.. copy():文件名不能为空[文件]

I jus have started getting error Array ( [type] => 2 [message] => copy(): Filename cannot be empty [file] => /home/fraptech/public_html/notredamedelhi.com/modifyhome.php [line] => 73 ) i.e. the HTTP_POST_FILES line Before a month the files wer getting uploaded successfully. This problem has started only now. And i haven't modified the code since then.

<?php
if ($_POST['Upload']) 
{
$file_name = $HTTP_POST_FILES['ufile']['name'];
$new_file_name="slider_photo1.jpg";
$path= "images/".$new_file_name;
if($ufile !=none)
{
if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path))
{
echo "Successful<BR/>"; 
}
 else
{
echo "Error ";
print_r(error_get_last());
}

Please help with the code.

  • 写回答

1条回答 默认 最新

  • dream0614 2013-09-07 05:58
    关注

    I can guess, php version has updated on server.

    b/c $HTTP_POST_FILES is deprecated.(PHP 4 >= 4.1.0, PHP 5)

    http://php.net/manual/en/reserved.variables.files.php.

    so this is not there.

    4.1.0 Introduced $_FILES that deprecated $HTTP_POST_FILES.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作