我想知道一旦打开文件是否可以将文件保存到其他文件夹。我目前的逻辑是 -
$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
}
答案 0 :(得分:1)
尝试:
if($size)
{
copy($myfile, $newfile); //$newfile - with full path!
}