Betreff: Aw:: Liaise uploadpfad bestimmen? von Micha578 am 03.03.2009 14:03:27
Also so sieht das in der uploader.php aus:
Zitat: /** * Check the file and copy it to the destination * * @return bool */ function upload($chmod = 0644){ if( $this->uploadDir == '' ){ $this->setErrors('Upload directory not set'); return false; }
if( !is_dir($this->uploadDir) ){ $this->setErrors('Failed opening directory: ' . $this->uploadDir); }
if( !is_writeable($this->uploadDir) ){ $this->setErrors('Failed opening directory with write permission: ' . $this->uploadDir); } if( !is_dir($this->uploadDir) ){ mkdir($this->uploadDir); chmod($this->uploadDir, 0777); }elseif( !is_writeable($this->uploadDir) ){ chmod($this->uploadDir, 0777); }
if( !$this->checkMaxFileSize() ){ $this->setErrors(sprintf('File Size: %u. Maximum Size Allowed: %u' , $this->mediaSize, $this->maxFileSize)); }
if( is_array($this->dimension) ){ if( !$this->checkMaxWidth($this->dimension[0])){ $this->setErrors(sprintf('File width: %u. Maximum width allowed: %u', $this->dimension[0], $this->maxWidth)); } if( !$this->checkMaxHeight($this->dimension[1])){ $this->setErrors(sprintf('File height: %u. Maximum height allowed: %u', $this->dimension[1], $this->maxHeight)); } }
if( !$this->checkMimeType() ){ $this->setErrors('MIME type not allowed: ' . $this->mediaType); }
if( !$this->checkExtension() ){ $this->setErrors('Extension not allowed: ' . $this->mediaName); }
if( count($this->errors) > 0 ){ return false; }
if( !$this->_copyFile($chmod) ){ $this->setErrors('Failed uploading file: ' . $this->mediaName); }
if( count($this->errors) > 0 ){ return false; } return true; }
Kann man damit was anfangen?
|