Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] File Uploading Class
#1

[eluser]NordicElf[/eluser]
I'm fairly new to CI and I'm loving it! It's so simple and it just works. However...
I am having an issue with the File Uploading Class. From my local box on WAMP, the file upload is really slow. If the images are tiny it's super quick but anything over 500kb and it's really slow. Like a few minutes to upload. I left the config values to no limit. My php.ini has 32Mb limits and my 4mb photo is taking longer than 5mins and counting on localhost!

xss filtering is off.

snippet from controller:
Code:
$config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'gif|jpg|png';
        $config['max_size'] = '0';
        $config['max_width'] = '0';
        $config['max_height'] = '0';
        $config['encrypt_name'] = TRUE;

        $this->load->library('upload', $config);

        if (!$this->upload->do_upload()) {
            $data['error'] = array('error' => $this->upload->display_errors());
        ...
        }

It all works the files eventually upload but the speed is going to be a problem on a live server.



Any ideas?

EDIT:

I ended up using this : http://pixelcone.com/jquery/ajax-file-upload-script/ and it was so simple and easy to implement! I'd still love to know why using ajax fixes php's slow file upload deal but I'm happy. So glad I never put flash on my site - don't know what I was thinking!
Anyway, I hope this will be useful to someone out there. Especially if you want to do multiple file uploads.
#2

[eluser]NordicElf[/eluser]
I see the fault is not with CI but php, unless I'm doing something else really crazy. I had the same issue doing it manually with $_FILES.

so I decided that I probably need to use ajax to make it work faster. I initially thought uploadify. After much hair pulling I got uploadify to work quite nicely OUTSIDE of CodeIgniter but I just can't get them to work together. i saw some hacks where you push it to the uploadify.php file but don't actually use the CI upload library. I also want to do a fair amount of image manipulation and db calls on each image.

What is the reason that you can't just send uploadify to the CI Upload file functions?

Thanks...




Theme © iAndrew 2016 - Forum software by © MyBB