Changeset 285 for branches/1.1dev
- Timestamp:
- Oct 21, 2007 12:01:16 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1dev/lib/Upload.inc.php
r203 r285 426 426 $new_file_names[] = array( 427 427 'name' => $file_name, 428 'mime' => $files['type'][$i], 428 429 'size' => filesize($file_path_name), 429 'extension' => strtolower(substr($file_name, strrpos($file_name, '.') + 1)), 430 'extension' => $this->getFilenameExtension($file_name), 431 'original_index' => $i, 430 432 ); 431 433 continue; … … 511 513 512 514 return file_exists($this->upload_directory_path . '/' . $file_name); 515 } 516 517 /** 518 * Get filename by glob pattern. Searches a directory for an image that matches the 519 * specified glob pattern and returns the filename of the first file found. 520 * 521 * @access public 522 * @param string $pattern Pattern to match filename. 523 * @return string filename on success, empty string on failure. 524 * @author Quinn Comendant <quinn@strangecode.com> 525 * @since 15 Nov 2005 20:55:22 526 */ 527 function getFilenameGlob($pattern) 528 { 529 $file_list = glob(sprintf('%s/%s', $this->upload_directory_path, $pattern)); 530 if (isset($file_list[0])) { 531 return basename($file_list[0]); 532 } else { 533 return ''; 534 } 513 535 } 514 536
Note: See TracChangeset
for help on using the changeset viewer.