Welcome Guest, Not a member yet? Register   Sign In
swfupload problems!
#11

[eluser]MMCCQQ[/eluser]
[quote author="XtraFile" date="1221146605"]I was just pointing out that SWFUpload does work on CI, and some searching will get the problem solved. I had no trouble integrating SWFUpload into a few major projects of mine, as long as you account for its (relatively few) quirks.
-Matt[/quote]


how you solved the "problem"?
#12

[eluser]Unknown[/eluser]
[quote author="mahuti" date="1221145464"]I gave up on swfupload. I MUCH prefer the following:
http://don.citarella.net/index.php/actio...-uploader/
I found it to be simpler & more reliable on all counts. It can't be styled with CSS, which is (as far as I'm concerned) is no big deal anyway. I created a CI specific version of that where all of the error reporting is handled by javascript on page, so basically the flash just needs styling changes from site to site. Unfortunately, I don't have that in a format that's easy to digest (yet) and I'm at the tail end of the gigantic project that required me to figure this stuff out in the first place so I have little time to spare. [/quote]

Hello!

I am new to CodeIgniter (as well as designing web applications). So far, everything has been going great and I'm really loving CI.

However, I'm stuck on implementing the "flashupload_customdir" that you recommended instead of swfupload. Specifically, I'm confused on transferring the inline PHP from the example index.php and upload.php into my controller. If you or anyone could post an example CI implementation of the flash uploader located here I'd be extremely grateful!
#13

[eluser]Chris Newton[/eluser]
BTW, I uploaded my full upload solution here This uses a modified version of what's at don.citarella, better suited to CodeIgniter, and portability. For most you won't need to touch the flash (except for looks.) and can handle the rest of the processing and error reporting with CI and JavaScript.

I've commented the file pretty extensively so you can see what's going on. Please feel free to PM me if you have any questions.

And MAKE SURE YOU UPDATE YOUR MIMES FILE so that your flash uploader (whichever you use) works correctly with codeigniter.
#14

[eluser]Mat-Moo[/eluser]
Hi Mahuti

Trying to get this to work Smile and I've got the code up, got the flash up but got a couple of questions :-

1) I keep getting a 404 after upload - I thought this was my uploads folder but that seems ok and I've tried several things
2) How do I get the upload button to only offer images and nothing else?
3) What do I need in order to change the size/dimension/colours of the switch object? I have an old copy of Flash 2004 MX - but never done anything with flash

Mat
#15

[eluser]OES[/eluser]
Hi Chaps.

I got swfupload to work no problem.

All you need to do is make sure you have the right paths in your javascript and use the normal upload library and change the mime types as per what the wikie said. http://codeigniter.com/wiki/SWFUpload/.

ie.

Code:
// within your header javascript for swf.

upload_url: "/pod_upload.html",    // Relative or absolte path to the SWF file.
file_post_name: "userfile", // This is the normal form field name.

Then as you can see my url points to pod_upload method.

// Method
function pod_upload()
{
    $config['upload_path'] = './assets/public/uploads/';
    $config['allowed_types'] = 'gif|jpg|jpe|jpeg|png';
    $config['max_size']    = '2000';
    $config['remove_spaces'] = TRUE;
    $config['encrypt_name'] = TRUE;
    
    $this->load->library('upload', $config);
    $this->upload->do_upload('userfile');
    
    if ( ! $this->upload->do_upload()):
        $file = "error";
    else:
        $data = $this->upload->data();
        $file = $data['file_name'] ;
    endif;
        
    echo $file; // You need to echo a result for SWF to action.
    }

Hope this helps you with swfUpload.
#16

[eluser]Chris Newton[/eluser]
[quote author="Mat-Moo" date="1227069280"]Hi Mahuti

Trying to get this to work Smile and I've got the code up, got the flash up but got a couple of questions :-

1) I keep getting a 404 after upload - I thought this was my uploads folder but that seems ok and I've tried several things
2) How do I get the upload button to only offer images and nothing else?
3) What do I need in order to change the size/dimension/colours of the switch object? I have an old copy of Flash 2004 MX - but never done anything with flash

Mat[/quote]

I didn't realize myself until earlier today... if you use an index.php file, you'll need to change the URL location in the view file. It's a param that's passed into the flash for the post processor. So, this needs to be updated to whatever you're using for your post processor. I should have put something like <?php echo base_url();?>uploads/process_flash_upload but I didn't. So change your link accordingly.

Code:
flashvars.uploaderurl="/index.php/uploads/process_flash_upload";
#17

[eluser]Chris Newton[/eluser]
And OES, swfUpload doesn't work correctly on some servers, regardless of the correctness of your paths. Some servers give you a "permanently moved" error, which causes it to choke. I have one of those servers, so it doesn't work for me in that case. The other flash uploader I linked to does work there however.

That being said, It's not like I'm totally against swfupload. It has some definite pluses. It's nice to have options though.
#18

[eluser]Mat-Moo[/eluser]
DUH! I should of seen that! Changed it to <?=site_url('uploads/process_flash_upload')?> and the correct path/link is there, but it still doesn't get called. At least I think not, I added an extra debug message in and enabled yours but my uploads folder (chmodded to 777), but nothing is showing in the log file Sad

TIA
#19

[eluser]Chris Newton[/eluser]
Try "/index.php/uploads/process_flash_upload" instead.... get rid of the site_url, see if that helps. I have a suspiscion.

Also, make sure that you can access another controller method if this is a new install. Sometimes only the default route works if the config is wrong.
#20

[eluser]Mat-Moo[/eluser]
[quote author="mahuti" date="1227126436"]Try "/index.php/uploads/process_flash_upload" instead.... get rid of the site_url, see if that helps. I have a suspiscion.

Also, make sure that you can access another controller method if this is a new install. Sometimes only the default route works if the config is wrong.[/quote]

Thanks but still a 404, maybe time to look at another option...




Theme © iAndrew 2016 - Forum software by © MyBB