Exemplo n.º 1
0
 private function check_file()
 {
     if ($this->type == 'img' && $this->file_name == conf('upload.types.img.noimage_filename')) {
         return false;
     }
     if (!$this->check_file_name()) {
         return false;
     }
     $raw_file_path = Site_Upload::get_uploaded_file_path($this->filename, 'raw', $this->type, $this->is_tmp);
     if (!file_exists($raw_file_path)) {
         if ($this->strage_type == 'normal') {
             return false;
         }
         return (bool) Site_Upload::make_raw_file_from_storage($this->filename, $raw_file_path, $this->strage_type, $this->type);
     }
     return true;
 }
Exemplo n.º 2
0
 protected function is_valid_file_object($filename_excluded_prefix)
 {
     $file_path = $this->get_upload_path($filename_excluded_prefix);
     if (is_file($file_path) && $filename_excluded_prefix[0] !== '.') {
         return true;
     }
     if ($this->options['storage_type'] != 'normal' && !file_exists($file_path)) {
         $file_name = $this->options['filename_prefix'] . $filename_excluded_prefix;
         if (Site_Upload::make_raw_file_from_storage($file_name, $file_path, $this->options['storage_type'], $this->options['upload_type'])) {
             return true;
         }
     }
     return false;
 }