Welcome Guest, Not a member yet? Register   Sign In
Problem with Gallery Image Uploading
#8

[eluser]jshultz[/eluser]
Ok, I've cleaned up the code to the point that I'm basically copying the user guide. Here's what I have:


Here's the Upload Function:

Code:
function do_upload() {

        $this->load->helper(array('form', 'url'));
        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'gif|jpg|png|jpeg';
        $config['max_size']    = '2000';
        $config['max_width']  = '1024';
        $config['max_height']  = '768';
        
        
        $this->load->library('upload', $config);
        $this->upload->do_upload();


    if ( ! $this->upload->do_upload())
            {
                $this->load->model('Gallery_model');

                $error = array('error' => $this->upload->display_errors());
                echo var_dump($error);
                $upload_info = $this->upload->data();
                echo var_dump($upload_info);

                $data['gallery_path'] = $this->gallery_path;
                $data['gallery_path_url'] = $this->gallery_path_url;
                
                $data['images'] = $this->Gallery_model->get_images();
                $data['page_title'] = 'Verde Valley Business Resource - Gallery Manager';
                $data['page'] = '/ads/gallery_view'; // pass the actual view to use as a parameter
                $this->load->view('container',$data);
            }    
            else
            {
                $data = array('upload_data' => $this->upload->data());
                
                $this->load->view('upload_success', $data);
            }
    }



Here's the view:

Code:
<div class="span-24">
<div class="span-6">&lt;?php include('about-include.php'); ?&gt;</div>

<div class="span-16 prepend-1">
    <h2>Welcome to the Ad Manager!</h2>

    &lt;?php
        
        echo $gallery_path; echo '<br/>';
        echo $gallery_path_url;
        
    ?&gt;
  
  <div id="gallery">
        &lt;?php if (isset($images) && count($images)):
            foreach($images as $image):    ?&gt;
            <div class="thumb">
                <a href="&lt;?php echo $image['url']; ?&gt;">
                    <img src="&lt;?php echo $image['thumb_url']; ?&gt;" />
                </a>                
            </div>
        &lt;?php endforeach; else: ?&gt;
            <div id="blank_gallery">Please Upload an Image</div>
        &lt;?php endif; ?&gt;
</div>
    
<div id="upload">
        &lt;?php
        echo form_open_multipart('/gallery/do_upload');
echo form_hidden('redirect', '/gallery/index');
        echo form_upload('userfile');
        echo form_submit('upload', 'Upload');
        echo form_close();
        ?&gt;        
    </div>
    
</div>
</div>


I'm not even messing with a model.

When I upload a file, it's still not going into the folder. I've tried different ways for formatting the path. I've made sure that the folder is 777. Here's the errors that I'm getting back:

array(1) { ["error"]=> string(102) "
The upload path does not appear to be valid.

The upload path does not appear to be valid.

" } array(13) { ["file_name"]=> string(0) "" ["file_type"]=> string(0) "" ["file_path"]=> string(0) "" ["full_path"]=> string(0) "" ["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) "" }


Any ideas?


Messages In This Thread
Problem with Gallery Image Uploading - by El Forum - 07-18-2010, 09:03 PM
Problem with Gallery Image Uploading - by El Forum - 07-19-2010, 08:48 PM
Problem with Gallery Image Uploading - by El Forum - 07-19-2010, 10:11 PM
Problem with Gallery Image Uploading - by El Forum - 07-20-2010, 08:04 AM
Problem with Gallery Image Uploading - by El Forum - 07-20-2010, 05:48 PM
Problem with Gallery Image Uploading - by El Forum - 07-22-2010, 07:31 PM
Problem with Gallery Image Uploading - by El Forum - 07-22-2010, 08:12 PM
Problem with Gallery Image Uploading - by El Forum - 07-31-2010, 10:20 AM
Problem with Gallery Image Uploading - by El Forum - 07-31-2010, 09:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB