2013-08-21 2 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! 
} 
관련 문제