
Yaf_Request_Simple::getFiles() 함수는 여러 파일이 업로드되는 경우도 처리할 수 있습니다.
예를 들어, 아래와 같은 코드를 작성했을 때, file1.txt, file2.txt, file3.txt가 업로드되는 경우, getFiles() 함수의 리턴 값은 다음과 같습니다.
#hostingforum.kr
php
$request = Yaf_Request_Simple::getInstance();
$fileNames = $request->getFiles('file');
리턴 값은 배열로 리턴될 것입니다. 배열의 키는 업로드된 파일의 이름이 되고, 값은 업로드된 파일의 경로가 됩니다.
#hostingforum.kr
php
array(
'file1.txt' => '/path/to/file1.txt',
'file2.txt' => '/path/to/file2.txt',
'file3.txt' => '/path/to/file3.txt'
)
이러한 배열을 통해 업로드된 파일의 이름과 경로를 쉽게 접근할 수 있습니다.
2025-06-14 06:30