Welcome Guest, Not a member yet? Register   Sign In
Upload data array is empty
#1

[eluser]NateL[/eluser]
Not quite sure what I'm doing wrong here - but I've followed the user guide and when I do a var_dump() on my upload data, it's all empty. I'd appreciate any help Smile

View
Code:
<?php
    
    echo form_open_multipart('manage/portfolio/add_process');
?>    
    Title<br />
    &lt;input type="text" name="title" /&gt;
    <br /><br />
    Description<br />
    &lt;textarea cols="55" rows="10" id="description" name="description"&gt;&lt;/textarea>
    <br /><br />
    Thumbnail - <span style="color:red; margin:0; padding:0;">Must be 490 x 220</span>
    <br />
    &lt;input type="file" name="userfile" size="20" /&gt;
    <br /><br />
    &lt;input type="submit" value="Next - Step 2" /&gt;

controller: portfolio/add_process
Code:
$config['upload_path'] = '/images/portfolio/';
$config['allowed_types'] = 'gif|jpg|jpeg|png';

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

var_dump($this->upload->data())    ; exit;

dumps this:
Code:
array(13) { ["file_name"]=>  string(0) "" ["file_type"]=>  string(0) "" ["file_path"]=>  string(18) "/images/portfolio/" ["full_path"]=>  string(18) "/images/portfolio/" ["raw_name"]=>  string(0) "" ["orig_name"]=>  string(0) "" ["file_ext"]=>  string(0) "" ["file_size"]=>  string(0) "" ["is_image"]=>  bool(false) ["image_width"]=>  string(0) "" ["image_height"]=>  string(0) "" ["image_type"]=>  string(0) "" ["image_size_str"]=>  string(0) "" }
#2

[eluser]pistolPete[/eluser]
Is the file uploaded though?

Is there an error message?
Code:
echo $this->upload->display_errors();
#3

[eluser]NateL[/eluser]
[quote author="pistolPete" date="1257377946"]Is the file uploaded though?

Is there an error message?
Code:
echo $this->upload->display_errors();
[/quote]

HA!

The upload path does not appear to be valid.

Adjusted it to an absolute path and it works :-)

Thanks for the help




Theme © iAndrew 2016 - Forum software by © MyBB