• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upload/thumbnail

#1
[eluser]felixk[/eluser]
Hey!

I've coded a image upload function and thumbnail creator. And it works well when I'm running it from my local server, but I've now moved it to another server, which causes the problem.

This is parts from my code!
Code:
// This part works!
        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'gif|jpg|jpeg|png';
        $this->load->library('upload', $config);

// Here comes the problem
        $root = "/Fredag/uploads/";
        //Array med alla uppladdningsinformation från "steg 1".
        $upload_data = $this->upload->data();
                
        // ------ STEG 2 ----- //
        $config['image_library'] = 'gd2';
        $config['source_image'] = $_SERVER['DOCUMENT_ROOT'].$root.$upload_data['orig_name'];
        $config['create_thumb'] = TRUE;
        $config['thumb_marker'] = ''; //ändelse innan filformatändelsen. (satt till noll)
        $config['new_image'] = $_SERVER['DOCUMENT_ROOT'].$root.'images/';

Quote:$_SERVER['DOCUMENT_ROOT'] = E:/www/fabrikenfredag.se/www
And the destination folder is E:www/fabrikenfredag.se/www/Fredag/uploads (/images/thumbs)

To sum up, the image is uploaded, but not resized. So it must be a problem to find the source image.

Thankful for help!


Messages In This Thread
Upload/thumbnail - by El Forum - 09-21-2009, 01:38 AM
Upload/thumbnail - by El Forum - 09-21-2009, 07:33 AM
Upload/thumbnail - by El Forum - 09-21-2009, 07:50 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.