Welcome Guest, Not a member yet? Register   Sign In
difficulty in uploading file
#1

[eluser]adityajoshi[/eluser]
my view is some thing like this

form action="http://localhost/version-2/add/collect" method="post" id = "1" class="def-form">
<div class="section">
<div class="row">
<label class="main-label">What</label>
&lt;input type="text" name = "event" id="autocomplete" class="field" /&gt;
</div>
&lt;?php
echo form_open_multipart('gallery');
echo form_upload('userfile');
echo form_submit('upload', 'Upload');
echo form_close();
?&gt;
&lt;input type="submit" class="main-btn" value="Add Event" /&gt;
<div class="cl">&nbsp;</div>
&lt;/form&gt;

my controller is

&lt;?php
var_dump($_POST);
class Add extends Controller{
public function __construct() {
parent::Controller();
$this->load->helper(array('form','url'));
$this->load->library('form_validation');
}
function index() {
$this->load->view('add_form');
}
function collect()
{
echo("checkpoint0");
$this->load->model('Gallery_model');
if ($this->input->post('upload')) {
echo("checkpoint1");
$this->Gallery_model->do_upload();
}
$data['images'] = $this->Gallery_model->get_images();
$this->load->view('gallery', $data);
}

my model is

&lt;?php
var_dump($_POST);
class Gallery extends Controller {

function index() {

$this->load->model('Gallery_model');

if ($this->input->post('upload')) {
$this->Gallery_model->do_upload();
}

$data['images'] = $this->Gallery_model->get_images();

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

}

}

some how it doesn't work had spent two days but still struck any help will be highly appreciated


Messages In This Thread
difficulty in uploading file - by El Forum - 06-25-2011, 07:32 PM
difficulty in uploading file - by El Forum - 06-25-2011, 11:14 PM
difficulty in uploading file - by El Forum - 06-26-2011, 01:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB