CodeIgniter Forums
How i can resize image form file upload ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: How i can resize image form file upload ? (/thread-20069.html)



How i can resize image form file upload ? - El Forum - 06-26-2009

[eluser]Unknown[/eluser]
Hello everbody.

Code:
$icon="./uploads/icon_place/$file_name";/// it's work
        // but i want to use file from $_FILES['myfile']['tmp_name'] i try it and dose't work
    $config['image_library'] = 'gd2';
    $config['source_image'] = $icon;
    //$config['create_thumb'] = TRUE;
    $config['maintain_ratio'] = TRUE;
    $config['width'] = 50;
    $config['height'] = 50;
    $config['new_image']="./uploads/icon_place/$file_name";
    
    
    
    $this->load->library('image_lib', $config);
    if ( ! $this->image_lib->resize())
    {
    echo $this->image_lib->display_errors();
    }
I want to use file form $_FILES ?
help me.


How i can resize image form file upload ? - El Forum - 06-27-2009

[eluser]jtkendall[/eluser]
Hi poppy, welcome to the CodeIgniter forums!

You have to upload the files with the Upload library before you can resize the file. A good example of using the Upload library (as well as many other things) can be found in the user guide: http://ellislab.com/codeigniter/user-guide/libraries/file_uploading.html

Hope that helps.


How i can resize image form file upload ? - El Forum - 06-28-2009

[eluser]jedd[/eluser]
There's also a new [url="http://net.tutsplus.com/videos/screencasts/easy-development-with-codeigniter/"]nettuts screencast on file uploading[/url] that may be worth your time. Even if it doesn't answer your question directly it might give you some useful insights.


How i can resize image form file upload ? - El Forum - 06-28-2009

[eluser]Unknown[/eluser]
thank everbody.

my solution

stop:
1 upload to host
2 resize form step file (file uploaded step 1)
3 delete file(file uploade step1)