Integrate uploadify with codeigniter

Googling around I've found several solutions, but not to my liking some even suggest to edit the fla. Well there's no problem with that if you want to.

The problem with the uploadify.swf is that if uploads the file relative to the .swf location.

So I've come up with a simple yet effective solution.

1.) Open the uploadify.php

//normally it should be like this:
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
$targetFile = $_REQUEST["folder"] . $_FILES['Filedata']['name'];

//just change it to:
$targetFile = getcwd();


Or set $targetFile to any directory of your liking.
Integrate uploadify with codeigniter Integrate uploadify with codeigniter Reviewed by Edward Legaspi on Wednesday, November 03, 2010 Rating: 5

1 comment:

Craig R Morton said...

Thanks, this helped loads!

Powered by Blogger.