Welcome Guest, Not a member yet? Register   Sign In
How i can resize image form file upload ?
#1

[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.
#2

[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-gui...ading.html

Hope that helps.
#3

[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.
#4

[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)




Theme © iAndrew 2016 - Forum software by © MyBB