Welcome Guest, Not a member yet? Register   Sign In
Trouble getting SWF Upload to work
#1

[eluser]Michael;[/eluser]
Good evening everyone,

I'm having a spot of trouble with this and after spending the last couple hours on forum searches and google searches I'm to the point of throwing my workstation out the window ... I know, Baaaaad idea.

Here's the deal, I'm trying to "mimic" the functionality of the Application Demo found on the SWFUpload site. As of yet, I have been unable to get my copy to bring up the file browse dialog box ... I'm almost certain this is a pathing problem, but have tried all manner of path and am still coming up with nothing. I'm hoping the great minds here will notice the absolutely ignorant mistake I have overlooked over and over and bail me out of a jam ..

I am accessing the "site" via a VM on my workstation that has the IP Address of 10.0.0.199, just so you are aware as you look over the code.

My folder structure may be a lil odd, so I'll post it here too:

/framework //Codeigniter system folder
/core //Core application folder
/administration //Administration application folder
-> /views
-> -> /gallery
-> -> -> upload_form.php
/public_html //Web Root
-> /assets
-> -> /css
-> -> /images
-> -> -> accept.png
-> -> /js
-> -> -> /swfupload
-> -> -> -> swfupload.js
-> -> -> -> swfupload_f9.swf
-> -> -> -> handlers.js

I'll post the code in the next post.

Thanks for any incite you might be able to provide. Smile
#2

[eluser]Michael;[/eluser]
On to the Code:

This is found in my jshelper.php:
Code:
function jsUploads() { // load swfupload
    $str = "<s-c-r-i-p-t type=\"text/javascript\" src=\"".base_url()."assets/js/swfupload/swfupload.js\"></s-c-r-i-p-t> ";
    $str .= "<s-c-r-i-p-t type=\"text/javascript\" src=\"".base_url()."assets/js/swfupload/handlers.js\"></s-c-r-i-p-t> ";
        $str .= <<<EOT
            [removed]
            var swfu;
            window<span class="button">Select Images <span style="font-size:x-small">(2 MB Max)</span></span>',
                button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 10pt; }',
                button_text_top_padding: 0,
                button_text_left_padding: 18,
                button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
                button_cursor: SWFUpload.CURSOR.HAND,

                // Flash Settings
                flash_url : "http://10.0.0.199/assets/js/swfupload/swfupload_f9.swf",

                custom_settings : {
                    upload_target : "divFileProgressContainer"
                },

                // Debug Settings
                debug: false
            });
        };
        [removed]
EOT;
        return $str;
    }

This code merely returns the necessary text in my view so that the js is present. I get no errors from this in Firebug in FF, that does not mean that it's correct obviously since all the paths are contained there.

This is from Controller:

Code:
function index() {
        $data['extraHeader'] .= jsUploads();
        $this->theme->setView('content', 'gallery/upload_form.php', $data);
        $this->theme->build(1);
    }

Literally all it does is load swfupload from the jshelper, abd display the theme.

And this is my view:

Code:
<div id="content">
    <h2>Application Demo</h2>
    <p>This demo shows how SWFUpload can behave like an AJAX application.  Images are uploaded by SWFUpload then some JavaScript is used to display the thumbnails without reloading the page.</p>
    &lt;?php    if( ! function_exists("imagecopyresampled") ){?&gt;
        <div class="message">
            <h4><strong>Error:</strong> </h4>
            <p>Application Demo requires GD Library to be installed on your system.</p>
            <p>Usually you only have to uncomment <code>;extension=php_gd2.dll</code> by removing the semicolon <code>extension=php_gd2.dll</code> and making sure your extension_dir is pointing in the right place. <code>extension_dir = "c:\php\extensions"</code> in your php.ini file. For further reading please consult the <a href="http://ca3.php.net/manual/en/image.setup.php">PHP manual</a></p>
        </div>
    &lt;?php    } else {?&gt;
        &lt;form&gt;
            <div style="display: inline; border: solid 1px #7FAAFF; background-color: #C5D9FF; padding: 2px;">
                <span id="spanButtonPlaceholder"></span>
            </div>
        &lt;/form&gt;
    &lt;?php    }?&gt;
    <div id="divFileProgressContainer" style="height: 75px;"></div>
    <div id="thumbnails"></div>
</div>

I believe this is *exactly* what is in the application demo found at the link above.
#3

[eluser]TheFuzzy0ne[/eluser]
I've read you're post 5 times now, and I simply don't get it. May I suggest you post a link to your demo app. It might be easier to see what's happening. If you can't get the browse file dialogue to open, it suggests to me that the path is set incorrectly in the app itself.




Theme © iAndrew 2016 - Forum software by © MyBB