Welcome Guest, Not a member yet? Register   Sign In
Simple upload problem
#1

[eluser]markanderson993[/eluser]
I am having considerable trouble getting my file field to be picked up by my controller. It is like the name field is not sending its value over to the controller. Every time I submit the form It gives me the same, "please fill in your file selection field". Ahh! Why does this happen?

If anyone has an explanation for this I would be very thankful.

Here is the controller:

Code:
if (isset($_POST['create_image_group']))
        {
            $image_group_name = $this->input->post('image_group_name');
            
            if ($image_group_name != '')
            {
                $this->upload_model->create_image_group($id,'custom',$image_group_name);
                $data['success'] = 'The image album entitled: <b>'.$image_group_name.'</b> has been successfully created';
            } else {
                $data['error'] = 'Please enter a title for your image group';
            }
        }

And the view

Code:
&lt;?php echo form_open_multipart('images/managealbums/'.$this->uri->segment(3));?&gt;

<div style="margin-top:5px;"><b>Select an album:</b>
<select style="font-size:11px;" name="image_group_id" >
&lt;?php if (isset($image_groups)): ?&gt;
    &lt;?php foreach($image_groups->result() as $row): ?&gt;
    <option value="&lt;?php echo $row->image_group_id?&gt;">&lt;?php echo $row->image_group_name?&gt;</option>
    &lt;?php endforeach; ?&gt;
&lt;?php endif; ?&gt;
</select></div>

<div style="margin-top:5px;"><b>Select an image</b></div>

&lt;input type="file" name="userfile" size="20" /&gt;

<div style="margin-top:5px;"><b>Title <span style="color:#666;font-size:9px;position:relative;top:-1px;">(optional)</span></b><br />&lt;input type="text" name="image_title"&gt;&lt;/div>

<div style="margin-top:5px;">
<b>Description <span style="color:#666;font-size:9px;position:relative;top:-1px;">(optional)</span></b>&lt;textarea name="image_desc" style="padding:2px;font-size:11px;font-family:Arial, Helvetica, sans-serif;width:100%;height:100px;"&gt;&lt;/textarea>
</div>

<div style="margin-top:5px;">&lt;input type="submit" name="upload_album_picture" value="upload" /&gt;&lt;/div>

&lt;/form&gt;


Messages In This Thread
Simple upload problem - by El Forum - 08-10-2008, 08:19 AM
Simple upload problem - by El Forum - 08-10-2008, 09:22 AM
Simple upload problem - by El Forum - 08-10-2008, 12:29 PM
Simple upload problem - by El Forum - 08-10-2008, 02:24 PM
Simple upload problem - by El Forum - 08-10-2008, 11:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB