2012-02-12 3 views
0

CMS 사진 갤러리를 시도하고 있으며 upload.php 파일 끝에 축소판을 만들어야합니다. 'showphotos.php'페이지에서 실행할 때 잘 작동하는 create_square_image라는 함수가 있습니다. 그러나 누군가가 페이지를 볼 때마다 실행되도록하고 싶지 않습니다. create_square_image (문자열 $ 파일 이름, 문자열 $ 대상, 크기) 내가 몇 번을 시도하고있다SWFUpload를 사용하여 축소판 만들기

: 나는

// Process the file 
/* 
    At this point we are ready to process the valid file. This sample code shows how to save the file. Other tasks 
    could be done such as creating an entry in a database or generating a thumbnail. 

    Depending on your server OS and needs you may need to set the Security Permissions on the file after it has 
    been saved. 
*/ 

$thumb_save = "uploads/thumbs/thumb_" . $_FILES[$upload_name]["tmp_name"]; 
create_square_image($_FILES[$upload_name]["tmp_name"],$thumb_save,100); 

if ([email protected]_uploaded_file($_FILES[$upload_name]["tmp_name"], $save_path.$file_name)) { 
    HandleError("File could not be saved."); 
    exit(0); 
} 

exit(0); 

create_square_image 기능이 형식을 사용하여 ... SWFUpload에 다음과 같은 추가 시도 이미지는 저장하지만 축소판은 저장하지 않습니다.

답변

0

/uploads/thumbs/의 권한을 777로 설정하십시오. 또한 해당 위치의 절대 경로를 지정해보십시오. 절대 경로를 보려면 다음 코드를 사용하십시오. echo getcwd();

관련 문제