class.upload with code Igniter? How to do?

See all posts Reply

class.upload with code Igniter? How to do? new!
by jonatan, 16 years, 7 months ago
I'd like to use this class instead the code igniter's native class to manipulate imagens. Is it possible?

I've created a library with class.upload file, made the 'load' but i dont know how to 'start' using the class...

sorry for my 'brazilian' english...Reply
Re: class.upload with code Igniter? How to do? new!
by colin, 16 years, 7 months ago
I am not familiar with Code Igniter, but from what I can see here, it should be possible to integrate the upload class in the framework, and extend its current upload capabilities.

It looks to me that
if ( ! $this->upload->do_upload())
should wrap the process() function of class.upload.phpReply
Re: class.upload with code Igniter? How to do? new!
by jonatan fróes, 16 years, 6 months ago
Instead extend, I create a new library

In class.upload we do that:
$foo = new  Upload($_FILES['form_field']);  

But in CI, we load the class this way:
$this->load->library('someclass');
It seems not be able to do
$foo = $this->load->library('someclass');
or
$foo = $this->load->library('someclass', $_FILES['form_field']);

I dont know where I put the $_FILES['form_field']...

my english is poor and I dont know if you will understand me...Reply
Re: class.upload with code Igniter? How to do? new!
by colin, 16 years, 6 months ago
I think you will have to create a wrapper class for the upload class. You would use it like this:

$foo = $this->load->library('someclass');
$this->someclass->init($_FILES['form_field']);
$this->someclass->image_resize(true);
etc.... It is one way to do it, but you can pass all the parameters in a different fashion.

Your library will then wrap the class.upload, and within the library, you will instantiate the upload class, set the parameters, etc...

I don't have the time to try, but that gives you an idea.Reply
Re: class.upload with code Igniter? How to do? new!
by onursvk, 12 years, 6 months ago
I've solved this problem or whatever you call it.
I've created a library named upload_lib and it has a function like upload_yap (in turkish) and it gets 1 parameter that your FILE name ( $_FILE['image'] etc.). I've wrote normal way verot upload scripts. I ve made it upload normal image and thumb at same time and those scripts go well then i ve returned an array of file destination names. If all controls go wrong i ve returned 0. And i ve load that library to my Controller and sent parameter to this library and i ve saw that it really works fine! ;) İf you want to see that codes you can text me ;) Regard.Reply
Re: class.upload with code Igniter? How to do? new!
by Eduardo, 11 years, 7 months ago
Could you send me your code? I have the same problem trying to use class.upload with CI and your code would help me a lote. ThanksReply