codeigniter教程之多文件上传使用示例(6)

/* Move the file to the final destination
       * To deal with different server configurations
       * we'll attempt to use copy() first.  If that fails
       * we'll use move_uploaded_file().  One of the two should
       * reliably work in most environments
       */
       if(!@copy($this->file_temp, $this->upload_path.$this->file_name)){
        if(!@move_uploaded_file($this->file_temp, $this->upload_path.$this->file_name)){
         $this->set_error("upload_destination_error");
         return FALSE;
        }
       }

/* Set the finalized image dimensions
       * This sets the image width/height (assuming the
       * file was an image).  We use this information
       * in the "data" function.
       */
       $this->set_image_properties($this->upload_path.$this->file_name);

//Set current file data to multi_file_upload_data.
      $this->set_multi_upload_data();
     }

//Return all file upload data.
     return TRUE;
   }
  }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/0370ffe02d07c62981c73c071ae8bee3.html