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

xbill82 wrote:

I have a very very dummy question.
I can't understand how the upload mechanism works... when I use the demo of the plugin I see the files are "safely stored in /dev/null" and that's ok, but... how do I change it? Where can I choose the destination directory for  my uploaded files?

Thanks for your patience... wink

L;)

If you see the code for this demo page, there's a uploader function that starts every time the single file gets uploaded, and all information about it is stored in the $_FILES[] variable. If you want to take this file, you should do it at this moment -- because later it will be automatically deleted.
Use, for example,

move_uploaded_file($_FILES[$key]["tmp_name"], $uploadname);

This is the way, as far as I understand.

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

thanks a lot q_no,
I'll check the link as soon as I can.

Bye!

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

wow... kinda messed the response messages.
Thanks to you as well, batch2k!

L,)

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

How I can look through all xajax debug using uour plugin? I have a problem with xajaxRequest. Maybe there is an error but I don't know what error is it 'cause I can't see debug (

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

Hello everybody.
I have a VERY VERY WEIRD behaviour in my xajax.SWFUpload application.
Thanks to your help the day 7th of May I was able to have everything working both with IE and Firefox.
Then I have followed working on the project (that is huge) and now I get a "Error code -220, File name: <myfilename>, Error Message: #2038" when trying to upload anything.
The curious things about the fact are:
1. no problem with IE.
2. the xajax.SWFUpload demo is included in the project and working perfectly both on IE and FF: it is using the same inc files that my app uses.
See? Isn't it weird?
There must be some error in my programming that I don't see, but I spent all the day revising my code and it's identical to the demo!
Does anybody know what does the #2038 error refers to?
Any suggestion?

Thanks a lot!
L;)

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

Updating the thread.
I have unfortunately focused the source of the problem. And I say unfortunately because this seems a crappy Firefox bug.
In fact the cause of the issue is a simple <select> field placed at the beginning of the form (into a table) that, regardless of its position in the document, makes the upload form crash with a #2038 error. If I simply comment the field everything works perfectly.
I tried to move the field into another <td> but same thing. I substituted the <select> with another type of input but same thing.
By the way, one curious thing is that the comment trick only works if the previous row in the table doesn't close its </td> (the row consists of <tr><td> .... <tr> without the </td>) OR if the <tr><td><!-- <select>.... --></td></tr> is placed at the beginning of the table.

Weird, uh?

I don't even know how to report this as a bug...

L;)

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

Hi,

I'm a bit confused what is exactly causing your issues. can you please post your form markup?

33 (edited by m[e]ntor 2008-05-27 10:22:26 AM)

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

feature request:

- classnames on all generated htmltags ( maybe configureable classnames)
- enable disable swfupload debug mode
- configureable fadingtime ( delete, onupload and so on)

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

Hello,
I solved my weird weird issue.
It went ok by erasing the xajax_getFormValues() from the call to the uploader.
anyway my markup is:

[code]<?xml version="1.0" encoding="utf-8"?>
   
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
    <head>   
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="lang" content="es"/>
    <meta name="locality" content="Granada, Espa

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

By the way it would be great to have some sort of debug tool to be able to see errors because even Firebug isn't able to catch swfUpload's POST messages...

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

Hi all,
About the mysterious #2038 error xbill82 reported. I got it too. I asked several friends online to access my website and test it. The results were very mysterious. So:

On several computers we did not get the error.

Then on two computers that have WinXpSp2 and FF2.0.0.14 I got the error on only of them. It worked on both IEs on these PCs.
Then on two computers (one with Vista and another with XP2) we always got the error.

On one IE7 I got the error only some times, not always!  I once got the error upon hitting the cancel button by the filename I wished to upload, that is, I got the error even when not specifically trying to upload the file! (I was amazed at that and yes, it's repeatable, see below).

I tried xbill82's solution of erasing the xajax_getFormValues() from the call to the uploader and it did not work. Another forum member mentioned that it was a <SELECT> tag inside a <TD>  that was causing the problem. I am using no <select>s on this page, so it can't be it.

I eventually got to pin down the one factor that's leading to the error, although I believe this is not the real cause of the error, it's only an unlucky trigger: I have a <textarea> in my form. When I leave it blank or fill it with little text, it works ok. When I fill it with a lot of text, then I get the error on all the computers and browsers.

I then got back to the 2 pcs that were always giving the errors and left the textarea empty or with little text and lo and behold, NO Error! If I fill the text area with a lot of text, I always get the error even when hitting the cancel button (<div class="swf_queued_file_remove"/>)

I think we need to go deeper and investigate to be able to effectivelly correct this problem. This plugin is too damn useful!  <select>s and <textarea>s and xajax_getFormValues() are legal to use and we need to use them in our forms. I don't think mysterious solutions are ok, because they either cripple our action or eventually let us down. I would like to help more, but at the moment I don't know how.

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

Interesting! I suppose it has something todo with flash and it's way to treat POST values. I'll check that soon. Could you maybe try to setup and example that reproduces this behaviour? That would speed up the debugging time wink

38 (edited by catballou 2008-06-12 3:26:16 PM)

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

q_no, unfortunately the dev location we could use is no longer usable as of right now. I'll post here as soon as I get to set another test environment up. Thanks for now!

39 (edited by batch2k 2008-07-07 10:26:44 AM)

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

Hi everyone, I probably encountered with some opera (9.2.7) compatibility issues.

I have two upload queues that are launched in the serial mode: the first one starts when user press "Upload files" button (JS "xajax_uploader_receptor(xajax.getFormValues('upload_form'))" in my case), and the second one launches from the "uploader_receptor" uploading handler, in order to start the second one just when the first is complete (it's easy because there's exactly 1 file in the first queue): PHP/XAJAX call "$objResponse->script("xajax_uploader_ligands(xajax.getFormValues('upload_form'));")".
But the second uploader handler "uploader_ligands" starts very strange from the opera (and normally from IE and FF): Some service code for moving uploaded files works (and files get uploaded), but any activity connected with the $objResponse object just disappear. I have there a line to redirect browser to another page when upload is complete, but it does not work (and simple "$objResponse->alert('test')" does not work either). The error console remains clear -- opera does not report any errors. I repeat, everything is OK with IE and FF.
Does anybody know how to overcome this difficulty?

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

batch2k, can you please provide a small demo-script that reproduces the issue in opera? Not sure what may cause your troubles...

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

Here is the code:
The first uploader handler (for file input with exactly one file in the queue allowed):

function uploader_receptor($aFormValues) {
    global $uploaddir;
    $objResponse = new xajaxResponse();

        ... <working code> ...

    $objResponse->script("xajax_uploader_ligands(xajax.getFormValues('upload_form'));"); // Here we launch the second uploader handler
    return $objResponse;
}

The second uploader handler (for multiple files):

function uploader_ligands($aFormValues) {
    global $uploaddir;
    $objResponse = new xajaxResponse();
    $ligand_queue = ($aFormValues['ligand_queue'] > 0) ? $aFormValues['ligand_queue'] : 0; // This is to detect when we are ready to go away

       ... <working code> ...

    if ($ligand_queue > 0) $objResponse->script("if (xajax.ext.SWFupload.instances['upFile_ligands'].getStats().files_queued == 0) {location.assign('?step=2');};"); // This is the code to check that we are ready to go away (all files in the queue are loaded).
    return $objResponse;
}

And the single call for both functions (in serial way):
<input id="uploadBtn" type="button" onclick="document.getElementById('ligand_queue').value=xajax.ext.SWFupload.instances['upFile_ligands'].getStats().files_queued;xajax_uploader_receptor(xajax.getFormValues('upload_form'));" value="Upload files" />

UPDATE:
The $objResponse in the second handler starts to work in opera when I comment the following php line:

$ligand_queue = ($aFormValues['ligand_queue'] > 0) ? $aFormValues['ligand_queue'] : 0;

This value is absolutely necessary to me, and I don't understand, how php code can interrupt JS-machine in Opera. I will be very thankful if you help me to find out what's the matter.

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

that sounds odd - I have no idea except the $aFormValues['ligand_queue']  value isn't set properly... how do you pass that value?

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

The value is passed as in xajax manuals and samples -- element of the form:

<form enctype="multipart/form-data" id="upload_form" onsubmit="return false;" method="post">
...
<input type="hidden" id="ligand_queue" name="ligand_queue" value="" />
...
</form>

and the passing this data is like following:

xajax_uploader_receptor(xajax.getFormValues('upload_form')) (JS)

This is done as in xajax wiki and manuals and works smoothly in IE and FF.

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

New RC1 not work with SWFupload (((( It only work with SWFupload package. How fix it?
PS For site I have new version of Xajax, for Image upload im use SWFupload package. Its bad and not beautyful.

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

i also want to know how to work in rc1
thank you

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

I want to know the way to make it works on RC1 too...

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

Hello,

I'm really sorry for the delay but I'm totally swamped at the moment. As if this wasn't enough my notebook crashed on monday and is fubar now. All my dev VMs and my swfupload code is locked on the harddisk. I'll try to come up with a patch in the next couple of days, but without any new features (due to the crash sad )

I hope you guys can stick with the svn rev provided with the swfupload package in the meantime.

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

New bug : when i refresh with Maxthon the SWF has no work!!!!!!!!!

what i can do?

thanks!

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

Fatal error with Flash 10 player plugin.
That's a pity, but swf-upload plugin is not compatible with new flash 10 player! It looks like that is works *only* with flash 9, and this is not good at all: it is not possible to download previous versions of the plugin from adobe site. Or at least it is not straightforward.
The problem is the following: when I installed new version of the plugin, "browse" buttons stopped working. No action. And the message in the JS-error console (FF3, Windows XP) is: "uncaught exception: Error calling method on NPObject! [plugin exception: Error in Actionscript. Use a try/catch block to find error.]."
Is there a way to overcome this difficulty? Because new users of the site will not able to use it...

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

Read this:
http://swfupload.org/forum/generaldiscussion/551

I think there won't be an update to the Xajax SWFupload plugin until the SWFupload itself is fixed. :-)