
Yaf_Request_Simple::getFiles 메서드는 여러 개의 파일을 선택했을 때, 배열로 반환합니다.
이 배열의 키는 파일의 이름이 아니라, 파일의 인덱스입니다.
예를 들어, 다음과 같은 경우를 생각해 보겠습니다.
- 사용자가 3개의 파일을 선택했을 때, getFiles 메서드는 다음과 같은 배열을 반환합니다.
#hostingforum.kr
php
array(
0 => array(
'name' => 'file1.txt',
'type' => 'text/plain',
'tmp_name' => '/tmp/php/phpuploadfile1.txt',
'error' => 0,
'size' => 1024
),
1 => array(
'name' => 'file2.txt',
'type' => 'text/plain',
'tmp_name' => '/tmp/php/phpuploadfile2.txt',
'error' => 0,
'size' => 2048
),
2 => array(
'name' => 'file3.txt',
'type' => 'text/plain',
'tmp_name' => '/tmp/php/phpuploadfile3.txt',
'error' => 0,
'size' => 3072
)
)
위의 예시에서, 배열의 키는 0, 1, 2로 파일의 인덱스를 나타내고 있습니다.
이러한 배열을 통해, 각 파일의 이름, 타입, 임시 저장 경로, 에러 코드, 크기를 확인할 수 있습니다.
2025-03-12 01:11