Changeset 301 for trunk/lib/Upload.inc.php
- Timestamp:
- Jan 24, 2008 4:30:46 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Upload.inc.php
r286 r301 303 303 'extension' => $file_extension, 304 304 'original_index' => $i, 305 'original_name' => $files['name'][$i], 305 306 ); 306 307 } else { … … 325 326 * @access public 326 327 * @param string $file_name A name of a file. 328 * @param bool $use_glob Set true to use glob to find the filename (using $file_name as a pattern) 327 329 * @return bool Success of operation. 328 330 */ 329 function deleteFile($file_name )331 function deleteFile($file_name, $use_glob=false) 330 332 { 331 333 $app =& App::getInstance(); … … 337 339 } 338 340 339 $file_path_name = $this->getParam('upload_path') . '/' . $file_name;341 $file_path_name = $this->getParam('upload_path') . '/' . ($use_glob ? $this->getFilenameGlob($file_name) : $file_name); 340 342 341 343 if (!is_file($file_path_name)) { … … 344 346 } else if (unlink($file_path_name)) { 345 347 $app->logMsg(sprintf('Deleted file: %s', $file_path_name), LOG_INFO, __FILE__, __LINE__); 348 return true; 346 349 } else { 347 350 $this->_raiseMsg(sprintf(_("The file %s could not be deleted."), $file_name), MSG_ERR, __FILE__, __LINE__);
Note: See TracChangeset
for help on using the changeset viewer.