【问题标题】:Codeigniter view url?Codeigniter 查看网址?
【发布时间】:2011-05-02 05:47:36
【问题描述】:

如果我使用绝对 url,我可以将图像上传到文件夹。 但是如何使用绝对网址呢?

function do_upload()
 {
  $config['upload_path'] = 'upload/';
  $config['allowed_types'] = 'gif|jpg|png';
  $config['max_size'] = '100';
  $config['max_width']  = '1024';
  $config['max_height']  = '768';

  $this->load->library('upload', $config);

  if ( ! $this->upload->do_upload())
  {
   $error = array('error' => $this->upload->display_errors());

   $this->load->view('upload_form', $error);
  } 
  else
  {
   $data = array('upload_data' => $this->upload->data());

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

以上是我的控制器代码。 我尝试上传,但我无法判断文件夹应该位于哪个路径?它应该在根目录中还是在控制器中还是在视图中?

【问题讨论】:

    标签: codeigniter file uploading


    【解决方案1】:

    它应该进入根目录。

    【讨论】:

      猜你喜欢
      • 2010-12-11
      • 2011-06-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-26
      • 2013-08-30
      • 1970-01-01
      相关资源
      最近更新 更多