开发者

CodeIgniger File Upload, Unable to spot error

I've been trying to uplaod a zip file with Codeigniter, something i've done before but cant seem to get to work this time. Here are my files:

View:

<h2>Add a New Album</h2>
<form method="post" enctype="multipart/form-data" action="<?php echo base_url(); ?>index.php/photo/newAlbum">
  <table>
    <tr>
        <td><p>Album Name:</p></td>
        <td><input type="text" name="aName" /></td>
    </tr>
    <tr>
        <td><p></p></td>
        <td><input type="file" name="userfile" size="20" /></td>
    </tr>
    <tr>
        <td><p></p></td>
        <td><input type="submit" value="Upload Images and Create Gallery" /></td>
    </tr>
  </table>
</form>

Controller:

        $config['upload_path'] = $path;
      开发者_开发知识库  $config['allowed_types'] = 'zip';


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

    if (!$this->upload->do_upload('userfile'))
    {
        $data['message'] = $this->upload->display_errors();

        $this->template->load('admin/template', 'admin/msg', $data);
    }
    else
    { $codeToBeWrittin }

The Error:

You did not select a file to upload.


How big is your file?

I'd check your PHP configuration to see whether your upload_max_filesize and post_max_size ini file parameters are sufficiently large to handle the upload.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜