0

I really dont know what I'm missing, I integrated Uploadify with my CodeIgniter based site and it's not working.

When I chose multiple images, some of them are say it's complete, and some of them give an IO Error, and the images never get uploaded to the folder

$('#file_upload').uploadify({
    'uploader'       : '<?php echo base_url(); ?>uploadify/uploadify.swf',
    'script'         : '<?php echo base_url(); ?>ihirdet/feltoltes',
    'cancelImg'      : '<?php echo base_url(); ?>uploadify/cancel.png',
    'folder'         : '<?php echo base_url(); ?>uploads/',
    'fileExt'        : '*.jpg;*.gif;*.png',
    'displayData'    : 'speed',
    'wmode'          : 'transparent',
    'simUploadLimit' : 5,
    'multi'          : true
});

and my controller

function feltoltes() {

    if ( ! empty($_FILES)) {
        $tempFile = $_FILES['file_input']['tmp_name'];
        $targetPath = $_SERVER['DOCUMENT_ROOT'] . '/SVN/handinhand/assets/images/galleries';
        $targetFile =  str_replace('//','/',$targetPath) . $_FILES['file_input']['name'];
        move_uploaded_file($tempFile,$targetFile);    
    }

    echo '1';
}

Does anybody see some error in these codes? Or just give me a hint?

Thank you

2
  • 1
    What is the specific error you're receiving? Commented Dec 8, 2011 at 15:42
  • Why aren't you using CI's File Upload Class? Commented Dec 8, 2011 at 17:42

1 Answer 1

3

This is strange... A click on a Similar Questions link next to your question led me to Getting Uploadify to work with Codeigniter? which led me to http://codeigniter.com/forums/viewthread/109751/ which is almost an exact duplicate of your question here... Paths and everything...

Anyway, did you try the solution in that CI thread? Are you allowing access to your uploadify scripts via .htaccess?

RewriteEngine on
RewriteCond $1 !^(index\.php|(.*)\.swf|uploadify|application|system|assets|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L] 
Sign up to request clarification or add additional context in comments.

1 Comment

Sorry, i was really tired when i posted this, and i didnt really do any search in google or on other sites because i wanted to do it my own but i ended up here, thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.