- Timestamp:
- 09/28/08 17:57:26 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
downloadDatabase/files/lib/data/downloadDB/DownloadDBData.class.php
r541 r668 34 34 */ 35 35 public function getURL() { 36 return DOWNLOADDB_FILE_DIR . intval($this->dataID) . '_' . StringUtil::encodeHTML($this->fileName); 36 if(file_exists(RELATIVE_WCF_DIR.DOWNLOADDB_FILE_DIR . intval($this->dataID) . '_' . StringUtil::encodeHTML($this->fileName))){ 37 return DOWNLOADDB_FILE_DIR . intval($this->dataID) . '_' . StringUtil::encodeHTML($this->fileName); 38 } 39 return DOWNLOADDB_FILE_DIR . 'Upload-' . $this->dataID . '.' . $this->fileExtension; 37 40 } 38 41 … … 62 65 public function deleteFile($fName) { 63 66 // delete file 64 @unlink(WCF_DIR.DOWNLOADDB_FILE_DIR . $this->dataID . '_' . $fName); 67 if(file_exists(RELATIVE_WCF_DIR.DOWNLOADDB_FILE_DIR . intval($this->dataID) . '_' . StringUtil::encodeHTML($fName))){ 68 @unlink(WCF_DIR.DOWNLOADDB_FILE_DIR . $this->dataID . '_' . $fName); 69 } else { 70 @unlink(WCF_DIR . DOWNLOADDB_FILE_DIR . 'Upload-' .$this->dataID . '.' . $this->fileExtension); 71 } 65 72 } 66 73 … … 71 78 public function deletePreview($fName) { 72 79 // delete file 73 @unlink(WCF_DIR . DOWNLOADDB_PREVIEW_DIR . $this->dataID . '_' . $fName); 74 @unlink(WCF_DIR . DOWNLOADDB_PREVIEW_DIR . 'thumbnail-' . $this->dataID . '_' . $fName); 80 if(file_exists(RELATIVE_WCF_DIR.DOWNLOADDB_PREVIEW_DIR . $this->dataID . '_' . $fName)){ 81 @unlink(WCF_DIR . DOWNLOADDB_PREVIEW_DIR . $this->dataID . '_' . $fName); 82 @unlink(WCF_DIR . DOWNLOADDB_PREVIEW_DIR . 'thumbnail-' . $this->dataID . '_' . $fName); 83 } else { 84 $fExt = StringUtil::toLowerCase(StringUtil::substring($fName, StringUtil::lastIndexOf($fName, '.') + 1)); 85 @unlink(WCF_DIR . DOWNLOADDB_PREVIEW_DIR . 'Preview-' . $this->dataID . '.' . $fExt); 86 @unlink(WCF_DIR . DOWNLOADDB_PREVIEW_DIR . 'thumbnail-' . $this->dataID . '.' . $fExt); 87 } 75 88 } 76 89
