7 Replies Latest reply on May 2, 2009 5:16 AM by Francisc

    EventListener not getting feedback from new server. Ideas?

    kmdguy Level 1

      Hi all,

       

      I wrote a Flex app that uploads some files to my server. I also have a progress bar that moves accordingly based on the ProgressEvent. Multiple files can be uploaded, each new one gets uploaded once the previous one gets the Event.COMPLETE information. Again, this app works fine, no problems.

       

      The Problem: This app was originally hosted on Server Host A and worked fine. We have since moved it to a completely different hosting company "Server Host B". We moved over all the files and everything that supports the app. Now however, when we try to upload files exactly as before, the progress bar might move one tick, but no other files get uploaded which tells me that the server is not sending back whatever information it is that the EventListener listens for. We've checked file/folder permissions, php script permissions and other stuff that I don't even understand. I know that Server B has some more stringent firewalls in place but I don't know how that might affect it. The weird thing is that using the application on Windows, the process works fine, the problem is only affecting people who log in using OSX either Firefox or Safari. Anyone have any ideas as to why OSX platforms might not be getting the EventListener data back from the server on Host B, yet on Host A it works fine?

       

      Thanks,

      Dan

       

      SAMPLE

      var urlVars:URLVariables = new URLVariables();

      urlVars.subID = subscriberID;

        urlVars.titleID0 = vTitleID0;

      urlVars.sceneID0 = vSceneID0;

      urlVars.routine = "routine0";

       

        uploadTarget.data = urlVars;

        uploadTarget.method = URLRequestMethod.POST;

       

        f.addEventListener(Event.COMPLETE, onDataComplete_0);

        f.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler_0);

        f.addEventListener(ProgressEvent.PROGRESS, progressHandler_0);

        f.addEventListener(Event.CANCEL, cancelHandler );

       

        myProgress.visible = true;

        f.upload(uploadTarget);

        • 1. Re: EventListener not getting feedback from new server. Ideas?
          Greg Dove Level 4

          This may not be it, (doesn't seem likely as you had it working with the other server, and perhaps the player has been fixed now).

           

          http://www.colettas.org/?p=200

           

           

          Another thing to check when some events don't fire on url requests in general might be local browser caching, although I can't recall experiencing that with uploads. You could perhaps try appending a random (GET) url variable to the uploadTarget's url you are using for the upload when you set it.

          uploadTarget:URLRequest = new URLRequest("site.com/upload.php?cacheBuster="+String(int(Math.random()*100000)));

           

           

          Not sure if there's anything there that might help...good luck.

          • 2. Re: EventListener not getting feedback from new server. Ideas?
            kmdguy Level 1

            Ya, the weird thing is that both Host A and Host B have the exact same app files, php scripts, everything. I can open Firefox on OSX, navigate to the one on Host A and it works a treat, multiple files upload fine on after the other, I can then clear the cache, clear everything out, open Firefox again and navigate to the one on Host B (the new host) and run the exact same app with the same scripts and only one file will upload become no Event.COMPLETE or Event.Progress information is sent back so it's got to be the host somehow, but I don't know what clues to have the host tech folks look for. They are asking "Well what kind of data should the server be sending back?" Truth is I have no idea, I've written this code based on books I've read about Flex and have it working, but I don't know what data the server sends back, where it comes from or how to check for it's presence.

            • 3. Re: EventListener not getting feedback from new server. Ideas?
              kmdguy Level 1

              As an additional bit of information. I am developing this inside of the MAMP environment and the exact same thing happens there too. My script successfully creates a folder in a certain directory and only uploads one file, but no feedback is sent back to the flex app to tell it "ya, this file is complete let's do the next one". So I'm wondering if I can solve it on my MAMP environment I can maybe replicate the same solution on the problematic host, but I just don't know where to begin looking for the possibilities.

              • 4. Re: EventListener not getting feedback from new server. Ideas?
                Greg Dove Level 4

                Are you familiar with php?

                 

                Is your php script echoing a response after the successful upload has been saved?

                 

                It does sound like that part is probably ok if it works ok under one host, and that it might be a configuration setting on the server if its doing the same thing locally from MAMP.

                 

                If it's saving the uploads ok, then it sounds like file permissions are ok. Perhaps there is a difference in the headers being sent back or something like that, based on some other configuration or ini settings - just guessing here, and its perhaps the same things you've already checked out. I can't say for sure, and its not my area of expertise, but I guess I'd look there first (too).

                • 5. Re: EventListener not getting feedback from new server. Ideas?
                  Francisc Level 3

                  If the exact same files and relative address to one another are the exact same from Server A, I would think it's Server B's configuration of the HTTP Server and the php.ini.

                   

                  But before that, see if there are any .htaccess files in server A's root and folders.

                  • 6. Re: EventListener not getting feedback from new server. Ideas?
                    kmdguy Level 1

                    Thanks folks for the feedback....I haven't found the solution just yet but I am trying to look at the phpinfo for both servers. I am not a PHP guru so I don't know if there is anything here, but I noticed some differences between the HTTP Request Headers. Might this be a possible source? Below is the comparison info:

                     

                    ////////////////////////////////////////////////////////////////////////////////////////// //

                    // BELOW IS THE INFO FOR THE SERVER THAT DOES NOT WORK

                    ////////////////////////////////////////////////////////////////////////////////////////// //

                    HTTP Request Headers

                    HTTP Request GET /phpinfo.php HTTP/1.1

                    Host 208.116.38.50

                    User-Agent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.10) Gecko/2009042315 Firefox/3.0.10

                    Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

                    Accept-Language en-us,en;q=0.5

                    Accept-Encoding gzip,deflate

                    Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7

                    Keep-Alive 300

                    Connection keep-alive

                     

                    HTTP Response Headers

                    X-Powered-By PHP/5.1.6

                    Connection close

                    Transfer-Encoding chunked

                    Content-Type text/html; charset=utf-8

                     

                     

                    ////////////////////////////////////////////////////////////////////////////////////////// //

                    // BELOW IS THE INFO FOR THE SERVER THAT WORKS

                    ////////////////////////////////////////////////////////////////////////////////////////// //

                    HTTP Request Headers

                    HTTP Request GET /phpinfo.php HTTP/1.1

                    Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

                    Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7

                    Accept-Encoding gzip,deflate

                    Accept-Language en-us,en;q=0.5

                    Connection keep-alive

                    Cookie __utma=14267444.1606541114845222700.1235332184.1238430113.1239209856.13; __utmz=14267444.1235332184.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

                    Host www.2257safe.com

                    Keep-Alive 300

                    User-Agent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.10) Gecko/2009042315 Firefox/3.0.10

                     

                    HTTP Response Headers

                    X-Powered-By PHP/5.2.8

                    Keep-Alive timeout=3, max=3

                    Connection Keep-Alive

                    Transfer-Encoding chunked

                    Content-Type text/html

                    • 7. Re: EventListener not getting feedback from new server. Ideas?
                      Francisc Level 3

                      While phpinfo can contain valuable info, try looking if there is a .htaccess file in folders related to SWF files from Flex and especially in the root folder.