2013-08-21 159 views
1

我想知道是否可以將文件保存到不同的文件夾,一旦打開它。我現在的邏輯是 -使用PHP將文件保存到不同的文件夾?

$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 
} 

回答

1

嘗試:

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