Re: [0.2.1] xajax.ext.SWFupload *updated*

Yep, that's correct... I'm not going to update the xajax plugin until there's a stable codebase for flash10 on swfupload.org.

Re: [0.2.1] xajax.ext.SWFupload *updated*

Good news everyone wink

I'm currently working on the FLASH10 version and made a good progress so far. Unfortunately I stumbled upon a small bug in 0.5RC2 and therefore we need to update the xajax core fist, before I can release the updated plugin. If you'r desperate and need an update immediately feel free to contact me by email.

53 (edited by Photoshop 2008-11-13 7:22:21 PM)

Re: [0.2.1] xajax.ext.SWFupload *updated*

Not work ((

I have this error.

ERROR: ExecuteCommand (#0, ):
Invalid response command: Malformed response command received.

Re: [0.2.1] xajax.ext.SWFupload *updated*

Hm, when does this error occur? What are you trying todo?

Please make sure that you have a clean install of xajax 0.5 rc2 and that you are using the latest version of the swfupload plugin.

55 (edited by Photoshop 2008-11-14 11:31:07 AM)

Re: [0.2.1] xajax.ext.SWFupload *updated*

Sorry when im download new swfupload 0.2.2, all works fine.

Re: [0.2.1] xajax.ext.SWFupload *updated*

where download ?

Re: [0.2.1] xajax.ext.SWFupload *updated*

See http://www.xajaxproject.org/plugins/default/view/18.

Re: [0.2.1] xajax.ext.SWFupload *updated*

flash 10?

Re: [0.2.1] xajax.ext.SWFupload *updated*

is there something new

Re: [0.2.1] xajax.ext.SWFupload *updated*

hi q_no:

      i download your file, and run the "swfupload.php", but it doesn't work. it seen it has JS error.  when i click the "Browse Files" button, the script-debugger show it has JS error :

function __flash__addCallback(instance, name) {
  instance[name] = function () {
    return eval(instance.CallFunction("<invoke name=\""+name+"\" returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) + "</invoke>"));
  }
}

this function has error, and it show this line error : return eval(instance.CallFunction("<invoke name=\""+name+"\" returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) + "</invoke>"));

so i can't see the effect, and i dont know how to debug.

can you help me, please?

(ie6,flash10,php5,xajax0.5)

Re: [0.2.1] xajax.ext.SWFupload *updated*

oh.......i found i visit this link also has error. is the code not finish?

http://www.xajaxproject.org/developer/q … upload.php

Re: [0.2.1] xajax.ext.SWFupload *updated*

Hello!
I'm currently using xajax.ext.SWFupload 0.2.1, for which I downloaded the full swfupload package form this site and extracted the xajax_core and xajax_js from this package. Everything is working fine.
Now I tried to use the modalWindow plugin, but I always get the error:
      ERROR: ExecuteCommand (#0, ): TypeError: e.style is undefined.
Then I downloaded the updated xajax files (xajax_core and xajax_js folders) and overwritten them to the current folders. Now modalWindow is working perfectly fine, but SwfUpload is giving the error:
      ERROR: ExecuteCommand (#0, ): Invalid response command: Malformed response command received.
Please tell me how can I use them both at the same time without any erros?

Re: [0.2.1] xajax.ext.SWFupload *updated*

Hi smughal, I'm just after trying both and they work fine together for me although I'm using xajax.ext.SWFupload 0.2.2 from http://www.xajaxproject.org/developer/q … upload.php (and modalWindow 0.9.0 b1 from http://www.xajaxproject.org/plugins/default/view/17).

I'd guess it's maybe your plugin setup is wrong. Mine looks like this:

xajax/xajax_plugins/request/swfupload/swfupload_f9.swf etc
xajax/xajax_plugins/response/modalWindow/modalWindow.inc.php etc

I'm using xajax 0.5 RC2 and Firefox 3.0.5 with Shockwave Flash 9.0 r124 plugin.

I can post the test script I used if you want.

Re: [0.2.1] xajax.ext.SWFupload *updated*

What's new about Flash 10?

Re: [0.2.1] xajax.ext.SWFupload *updated*

Hello dickdock!
I used the same versions and the same plugin setup as you mentioned but it still give the same error.
Can you please post the test script so I can see what I'm doing wrong?
Thank you.


dickdock wrote:

Hi smughal, I'm just after trying both and they work fine together for me although I'm using xajax.ext.SWFupload 0.2.2 from http://www.xajaxproject.org/developer/q … upload.php (and modalWindow 0.9.0 b1 from http://www.xajaxproject.org/plugins/default/view/17).

I'd guess it's maybe your plugin setup is wrong. Mine looks like this:

xajax/xajax_plugins/request/swfupload/swfupload_f9.swf etc
xajax/xajax_plugins/response/modalWindow/modalWindow.inc.php etc

I'm using xajax 0.5 RC2 and Firefox 3.0.5 with Shockwave Flash 9.0 r124 plugin.

I can post the test script I used if you want.

Re: [0.2.1] xajax.ext.SWFupload *updated*

Hi smughal, it's a bit of a mess being a mashup of the swfupload demo and a previous test script I had for modalWindow but anyway:

<?php

session_start();
if (!isset($_SESSION['foo'])) $_SESSION['foo'] = 0;

define('DM_AJAX_FULLDIR', '../xajax/'); // NOTE: Change for your system.
define('DM_AJAX_URI_PATH', '/include/'); // NOTE: Change for your system.
require_once DM_AJAX_FULLDIR . 'xajax_core/xajax.inc.php';
require_once DM_AJAX_FULLDIR . 'xajax_core/xajaxPluginManager.inc.php';
require_once DM_AJAX_FULLDIR . 'xajax_plugins/response/modalWindow/modalWindow.inc.php';
require_once DM_AJAX_FULLDIR . 'xajax_plugins/request/swfupload/swfupload.inc.php';

function modalWindow($count) {
    error_log("modalWindow($count)");
    $window_content = <<<EOT
<div style="width:450px;height:300px;background:#FFFFFF;color:#000000;border:1px solid #999999;padding:5px">
<a href="javascript:void(0)" onclick="xajax_closeWindow()">close</a><br/>
<a href="javascript:void(0)" onclick="xajax_modalWindow(XXXX)">open new Window</a><br/>
<form id="form_XXXX" method="post" enctype="multipart/form-data" onsubmit="return false;">
<input id="upload_field_XXXX" name="upload_field" value="" type="text" style="width:100px;"/>
<input type="submit" value="upload" onclick="xajax_uploader(xajax.getFormValues('form_XXXX'));"/>
<input name="count" type="hidden" value="XXXX"/>
</form>
</div>
EOT;
    $window_content = str_replace('XXXX', ++$count, $window_content);
    $args = array('color' =>  '#000000', 'opacity' =>  20, 'frame' =>  'parent', 'bOverlay' =>  true);
    $objResponse = new xajaxResponse;
    $objResponse->plugin('clsmodalWindow', 'addWindow', $window_content, $args);
    $objResponse->script("xajax_field_transform('upload_field_$count');");
    return $objResponse;
}

function closeWindow() {
    error_log("closeWindow");
    $objResponse = new xajaxResponse;
    $objResponse->plugin( 'clsmodalWindow', 'closeWindow');
    return $objResponse;
}

function uploader($aFormValues) {
    error_log("uploader aFormValues=" . print_r($aFormValues, true));
    $objResponse = new xajaxResponse();
    $html="";
    foreach ($_FILES as $key => $file) {
        $html .="
            <div style=\"border:1px solid #f0f0f0;background:#fff;padding:4px;margin-bottom:4px;\">
                <div style=\"float:left;width:100px;\">Filename:</div>
                <div style=\"float:left;\">".$_FILES[$key]['name']."</div>
                <br style=\"clear:both;\" />
                <div style=\"float:left;width:100px;\">Size:</div>
                <div style=\"float:left;\">".$_FILES[$key]['size']."</div>
                <br style=\"clear:both;\" />
                <div style=\"float:left;\">\$_SESSION request counter: ".$_SESSION['foo']."</div>
                <br style=\"clear:both;\" />
            </div>
            "    ;
    }
    if ("" == $html) $html="empty queue";
    $objResponse->append("results","innerHTML",$html);

    return $objResponse;
}

$xajax = new xajax;

$xajax->configure('javascript URI', DM_AJAX_URI_PATH); // NOTE: Change for your system.
$xajax->register(XAJAX_FUNCTION, 'modalWindow');
$xajax->register(XAJAX_FUNCTION, 'closeWindow');
$xajax->register(XAJAX_FUNCTION, "uploader", array("mode" => "'SWFupload'"));

$_SESSION['foo']++;
$xajax->processRequest();

?>
<html>
<head>
<title>Test</title>
<?php $xajax->printJavascript(); ?>
<style type="text/css">
.swf_queued_file { background:#f0f0f0; margin-bottom:2px; border:1px solid #c0c0c0; padding:4px; clear:both; }
.swf_queued_file_removed { background:#FFDFDF; margin-bottom:2px; border:1px solid #c0c0c0; padding:4px; clear:both; }
.swf_queued_file_finished { background:#DFFFE6; margin-bottom:2px; border:1px solid #c0c0c0; padding:4px; clear:both; }
.swf_queued_file_remove { font-size:11px; float:left; width:20px; height:20px; background:#505050; overflow:hidden; }
.swf_queued_filename{ font-size:11px; display:inline; float:left; width:180px; overflow:hidden; }
.swf_queued_file_progress_container { float:left; display:inline; background:#d0d0d0; margin-top:4px; height:10px; width:220px; margin-right:8px; }
.swf_queued_file_progress_bar { height:8px; background:#333; width:1px; }
.swf_queued_filesize{ font-size:11px; float:left; overflow:hidden; }
#response { border:1px solid #c0c0c0; background: #fAfAfA; padding:10px; float:left; width:530px; margin-left:20px; margin-top:10px; }
</style>
</head>
<script type="text/javascript">
function xajax_field_transform(field_id) {
    xajax.ext.SWFupload.tools.transField(field_id, {
                file_types: "*.jpg;*.gif;*.png;",
                file_types_description: "Web Image Files",
                file_size_limit: "5 MB",
                upload_complete_handler: "function () {}"
            }, false);
}
</script>
<body onload="xajax_field_transform('upload_field_id');">
<form id="main_form" method="post" enctype="multipart/form-data" onsubmit="return false;">
<input name="count" type="hidden" value="XXXX"/>
<input type="button" value="modal" onclick="xajax_modalWindow(1);">
<input id="upload_field_id" name="upload_field" value="" type="text" style="width:100px;"/>
<input type="submit" value="upload" onclick="xajax_uploader(xajax.getFormValues('main_form'));" >
</form>
<div id="response"> <h2>response</h2> <div id="results"> </div> </div>
</body>
</html>

In case you missed it note that the modalWindow author m[e]ntor replied to you here http://community.xajaxproject.org/viewt … 693#p26693

Re: [0.2.1] xajax.ext.SWFupload *updated*

Hello dickdock!
Thanks for posting the Code.
I used the code, configured everything according to my system (even I made the system according to yours), and when i excuted the file, it says:
Fatal error: Cannot redeclare class xajaxRequestPlugin in C:\wamp\www\eTeam\KhaoPeyo.com\Software\GUI\library\js\xajax_core\xajaxPlugin.inc.php on line 102
!!!
Any guess?

Re: [0.2.1] xajax.ext.SWFupload *updated*

Hi smughal, sorry I have a slightly modified xajax where I've replaced some requires with require_onces just to avoid such tedious dependencies but if you delete the require_once xajaxPluginManager and move the $xajax = new xajax; up to before the remaining plugin requires it should hopefully work, ie

...
require_once DM_AJAX_FULLDIR . 'xajax_core/xajax.inc.php';

$xajax = new xajax;

require_once DM_AJAX_FULLDIR . 'xajax_plugins/response/modalWindow/modalWindow.inc.php';
require_once DM_AJAX_FULLDIR . 'xajax_plugins/request/swfupload/swfupload.inc.php';

function modalWindow($count) {
...etc

If you're interested the script I use to patch xajax, doing the require_once replacements and also making it PHP5 strict compatible is here http://community.xajaxproject.org/viewt … 274#p26274 (My first ever post!)

69 (edited by smughal 2008-12-26 10:17:40 AM)

Re: [0.2.1] xajax.ext.SWFupload *updated*

Great dickdock, one problem is solved.
At least I'm not getting the  ExecuteCommand (#0, ) error.
However, everytime I give the filename and press the upload button, it says "empty queue".
I also tried by changing the type of upload_field to "file" and browse to any image file but it still says empty queue. Do I have to configure something?
Thank you again.


dickdock wrote:

Hi smughal, sorry I have a slightly modified xajax where I've replaced some requires with require_onces just to avoid such tedious dependencies but if you delete the require_once xajaxPluginManager and move the $xajax = new xajax; up to before the remaining plugin requires it should hopefully work, ie

...
require_once DM_AJAX_FULLDIR . 'xajax_core/xajax.inc.php';

$xajax = new xajax;

require_once DM_AJAX_FULLDIR . 'xajax_plugins/response/modalWindow/modalWindow.inc.php';
require_once DM_AJAX_FULLDIR . 'xajax_plugins/request/swfupload/swfupload.inc.php';

function modalWindow($count) {
...etc

If you're interested the script I use to patch xajax, doing the require_once replacements and also making it PHP5 strict compatible is here http://community.xajaxproject.org/viewt … 274#p26274 (My first ever post!)

Re: [0.2.1] xajax.ext.SWFupload *updated*

Hi smughal, sorry but I can't think what could be going wrong for you - the "empty queue" message means that there's nothing in the $_FILES array, ie the browser isn't uploading anything for some reason. The only relevant configuration I can think of is upload_max_filesize and post_max_size in php.ini, but they would also affect the standard browser upload as well so assuming that works for the same files then I'm stumped.

Re: [0.2.1] xajax.ext.SWFupload *updated*

I should add that I've only run the test script on Firefox, not on IE, in case that's what you're using.

Re: [0.2.1] xajax.ext.SWFupload *updated*

Will there ever be a Flash 10 version of this plugin?

73 (edited by NabiKAZ 2009-10-22 4:08:36 PM)

Re: [0.2.1] xajax.ext.SWFupload *updated*

Hi,
When i upload 2 files, the 'uloader' function called twice, so if i insert fields of form to the database, that inserted for twice(2times)!
Try this:

function uploader($aFormValues) {
    $objResponse = new xajaxResponse();
    $html .= "file1: " . $_FILES['upFile_standard']['name'] . "\n";
    $html .= "file2: " . $_FILES['upFile_standard2']['name'] . "\n";
    $html .= "post: " . $aFormValues['foo'];
    $objResponse->alert($html);
    return $objResponse;
}

But must, after uploaded 2 files, field inserted to database just for one time.

Thanks
Nabi

Re: [0.2.1] xajax.ext.SWFupload *updated*

Hi All,

Where the !@#$ is the latest  SWF Upload plugin code?

Edit:

I found a really simple upload that incorporates into my XAJAX pages very simply:

http://www.ajaxf1.com/tutorial/ajax-fil … orial.html

The html goes in your html and the php page saves the uploaded file.

On returning to the html, if the upload was successful, I call my registered function in the
current page to process the uploaded file.

If there is much interest I'll post some code...

Ed

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

Re: [0.2.1] xajax.ext.SWFupload *updated*

edrobinson wrote:

If there is much interest I'll post some code...

Yes, please do.