dqcuq4138 2011-04-13 19:27
浏览 6
已采纳

too long

I am getting the following error:

 Directory index forbidden by rule: /Users/User/Desktop/Local/House/includes/uploads/gallery/, referer: http://house.dev.local/admin/deleteimage

.htaccess

# Customized error messages.
 ErrorDocument 404 /index.php

 # Set the default handler.
DirectoryIndex index.php

# Various rewrite rules.
 <IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond $1 !^(index\.php|css|js|images|files|scripts|robots\.txt)
 RewriteRule ^(.*)$ index.php/$1 [L,QSA]
 </IfModule> 

Delete Image

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Addimage extends CI_Controller { 

function __construct(){ 
parent::__construct(); 
} 
function index() { 
if(!$this->session->userdata('logged_in')) { 
    redirect('admin/home'); 
} 
// Main Page Data 
$data['cms_pages'] = $this->navigation_model->getCMSPages(); 
$data['title'] = 'Add Gallery Image'; 
$data['content'] = $this->load->view('admin/addimage',NULL,TRUE); 

$this->load->view('admintemplate', $data); 

//Set Validation 
//$this->form_validation->set_rules('userfile', 'userfile', 'trim|required'); 
$this->form_validation->set_rules('description', 'Description', 'trim|required'); 

if($this->form_validation->run() === TRUE) { 

//Set File Settings 
$config['upload_path'] = 'includes/uploads/gallery/'; 
$config['allowed_types'] = 'jpg|png'; 
$config['remove_spaces'] = TRUE;
$config['overwrite'] = TRUE;
$config['max_size'] = '100'; 
$config['max_width'] = '1024'; 
$config['max_height'] = '768'; 

$this->load->library('upload', $config);
if(!$this->upload->do_upload()) {

$error = array('imageError' => $this->upload->display_errors());
}
else{
$data = array('upload_data' => $this->upload->data());
$config['image_library'] = 'GD2';
$config['source_image'] = $this->upload->upload_path.$this->upload->file_name;
$config['new_image'] = 'includes/uploads/gallery/thumbs/';
$config['create_thumb'] = 'TRUE';
$config['thumb_marker'] ='_thumb';
$config['maintain_ratio'] = 'FALSE';
$config['width'] = '200';
$config['height'] = '150';

$this->load->library('image_lib', $config);
$this->image_lib->resize();
}

$file_info = $this->upload->data();

$data = array(   
    'description' => $this->input->post('description', TRUE), 
    'fullpath' => $file_info['file_name'],
'thumbpath' =>$file_info['raw_name'].'_thumb'.$file_info['file_ext'] 
    ); 
$this->image_model->addImage($data);

$this->data['success'] = 'Thank You, Your Image Has Been Uploaded';
} 
 } 

 }
  • 写回答

1条回答 默认 最新

  • dr637349 2011-04-19 00:53
    关注

    I fixed this issue, I had mac web sharing on which I had forgotten about

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等