【问题标题】:Save a file to a different folder using php?使用php将文件保存到不同的文件夹?
【发布时间】:2013-08-21 16:15:39
【问题描述】:

我想知道打开文件后是否可以将文件保存到其他文件夹。我目前的逻辑是-

$myfile = $_POST['file']; // gets path of (in this case an image)
$size = getimagesize($myfile);  //for some reason I get an error message when this fails
// I'm assuming there is a better way of determining if the file is an image file or not.
if($size)
{
    //save file to said file path
}

【问题讨论】:

    标签: php file save


    【解决方案1】:

    试试:

    if($size)
    {
        copy($myfile, $newfile); //$newfile - with full path!
    }
    

    【讨论】:

      猜你喜欢
      • 2021-07-15
      • 2018-07-28
      • 1970-01-01
      • 2014-02-26
      • 1970-01-01
      • 2012-08-29
      • 1970-01-01
      • 2012-08-31
      • 1970-01-01
      相关资源
      最近更新 更多