Topic: File upload not working when using basic code from the documentation

I can't get SWFupload to work.  Here is a basic rundown of the code.  My declarations:
[code=PHP]
require_once("../xajax/xajax_core/xajax.inc.php");
$xajax = new xajax();
require_once '../xajax/xajax_plugins/request/swfupload/swfupload.inc.php';
$xajax->configure("javascript URI","/swfupload/xajax/");
[/code]
...and for registering a function to SWFupload:
[code=PHP]
$xajax->register(
    XAJAX_FUNCTION,
    "uploader",
    array("mode" => "'SWFupload'", "SWFform" => "'upload_form'")
);
$xajax->processRequest();
[/code]
...with the form marked up like this:
[code=HTML]
<form enctype="multipart/form-data" id="upload_form" action="upload.php" onsubmit="return false;" method="post" >
    Choose a file:
    <input type="file" id="upFile_standard" name="upFile_standard" value="" /><br />
    <input id="uploadBtn" type="button" onclick="xajax_uploader(xajax.getFormValues('upload_form'));" value="upload file"/>
</form>
[/code]

My other xajax functions are working just fine, and xajax does post to the uploader() function.  However, nothing is in the $_FILES global.

In the rendered page, I see this markup (onFilterECOs is another function registered to xajax):
[code=HTML]
<script type='text/javascript' charset='UTF-8'>
/* <![CDATA[ */
xajax_onFilterECOs = function() { return xajax.request( { xjxfun: 'onFilterECOs' }, { parameters: arguments } ); };
xajax_uploader = function() { return xajax.request( { xjxfun: 'uploader' }, { parameters: arguments, mode: 'SWFupload', SWFform: 'upload_form' } ); };
/* ]]> */
</script>

<script type='text/javascript' charset='UTF-8'>
/* <![CDATA[ */
if (undefined == xajax.ext) xajax.ext = {};xajax.ext.SWFupload = {};xajax.ext.SWFupload.config = {};xajax.ext.SWFupload.config.javascript_URI='../xajax/xajax_plugins/request/swfupload/'/* ]]> */
</script>

<script type='text/javascript' src='../xajax/xajax_plugins/request/swfupload/swfupload.js' charset='UTF-8'></script>

<script type='text/javascript' src='../xajax/xajax_plugins/request/swfupload/swfupload.queue.js' charset='UTF-8'></script>

<script type='text/javascript' src='../xajax/xajax_plugins/request/swfupload/swfupload.xajax.js' charset='UTF-8'></script>

[/code]

I am using version 'xajax 0.5 Beta 4' on a Mac; served by Apache 1.39; in Firefox 3.  Everything looks like it's supposed to.  There's a lot more PHP and Javascript activity in the page, but I don't see how any of that code would interfere.  Am I missing something here?

Re: File upload not working when using basic code from the documentation

you should use the xajax rev provided with the swfupload package, otherwise it won't work.

3 (edited by janoss 2008-09-10 3:17:36 AM)

Re: File upload not working when using basic code from the documentation

I am having the same difficulty with the $_FILES being empty when the xajax_uploader function gets called.

I used the xajax rev which was included in the swfupload zip file. I noticed it was labeled version version 'xajax 0.5 Beta 4' in the Copyright file.
Still no success getting the $_Files set in the uploader function. 

Th text boxes that are part of the <input type=file> do not appear as well.  I am using Firefox on Ubuntu 8 using apache2. 

When I browse and select the file, all of the Div areas get populated, then when I hit 'upload' the div are below the Browse button shows the file upload and size. However the results div area never gets populated. It seems that it it not getting called on the upload. After the div areas clear, I hit upload again, and I receive the 'Empty' message since $_FILES is empty.

When I run the demo located at:

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

using firefox on Ubuntu 8, the Response di area does not update. When I run the demo from Win XP, all works.

So, I think I just have an incompatible version of xajax or firefox. I did use the xajax directory that was part of the swfupload zip file.

Any other ideas or suggestions?

Re: File upload not working when using basic code from the documentation

janoss wrote:

using firefox on Ubuntu 8, the Response di area does not update. When I run the demo from Win XP, all works.

Hi Janoss,

I'm sorry but you have an incompatible OS. The flashplayer plugin doesn't work properly on Linux system as far as I know.