8 Replies Latest reply on Aug 3, 2007 4:55 PM by SummerLongSince

    File Upload

    SummerLongSince
      HI,
      I am customizing the file upload example on Flash CS3. I am making a file upload system in which the user selects between a single or multiple files upload option. Once the choice is made a screen where he/she can press a button to open a system dialogue box to navigate/select file(s) for uploading.

      It all works fine the first time. but whenever I tried it a second time this is the error I get:

      quote:

      Error: Error #2041: Only one file browsing session may be performed at a time.
      at flash.net::FileReference/browse()
      at com.uploader::FileUpload/init()
      at MethodInfo-240()


      My question is how can I close a browse section once I have successfully upload a file(s)?

      Thanks so much,

      Mauricio
        • 1. Re: File Upload
          kglad Adobe Community Professional & MVP
          use the attach code option to show your code.
          • 2. Re: File Upload
            SummerLongSince Level 1
            Hi Kglad,
            thanks for looking into this. If you prefer I can also email you a zip version of these files,
            Thanks,
            m.

            • 3. Re: File Upload
              kglad Adobe Community Professional & MVP
              i don't want to go through all that code. remove the parts of that code that are unrelated to your problem and post only the minimum code needed to display the problem.
              • 4. Re: File Upload
                SummerLongSince Level 1
                HI kglad,

                Sorry for sending all that code before.
                Below is an stripped down version. In my project I need 2 buttons, 1 for single file uploads, and another one for multiple. The referenced class manages both types of uploads.
                In the example below I'm just showing the single file upload part.

                Thanks for your insights.

                • 5. Re: File Upload
                  kglad Adobe Community Professional & MVP
                  i don't see how that can work, at all. where's UPLOAD_URL defined?
                  • 6. Re: File Upload
                    SummerLongSince Level 1
                    oh, I does work. I just removed many lines of code that seemed unnecessary for this troubleshooting. Among those I removed are the sessions where I declare all the variables to be used in the class, the imports of external classes, etc. The one that you're asking for is:

                    private const UPLOAD_URL:String = " http://localhost/~mauro/SaoPaulo/imageUploader.php";

                    And is defined right after the class is stated:
                    public class FileUpload {... variables declaration begins here...}
                    ).

                    Do you want me to send you a revised version of my stripped down code?

                    thanks for your help.
                    • 7. Re: File Upload
                      kglad Adobe Community Professional & MVP
                      when you run into a problem, try and isolate it. if necessary create a new fla that contains just the elements needed to display the problem. try and delete more and more elements from that new fla until you pinpoint the issue.

                      then with the issue pinpointed, if you can't figure out why you have a problem, ask for help.
                      • 8. Re: File Upload
                        SummerLongSince Level 1
                        Thanks for the advice. This is a detailed explanation of what is happening and included is a strip down version to its minimum details of a still functional piece of code:

                        The code I have is my customization of the upload example provided by adobe. What I did works well with both single and multiple file uploads. But only the first time. Whenever I try to repeat the process a second or third time I get this error:

                        Error: Error #2041: Only one file browsing session may be performed at a time.
                        at flash.net::FileReference/browse()
                        at com.uploader::FileUpload_stripped/init()
                        at MethodInfo-222()

                        It doesn't prevent me from continuing [i didn't set listeners for errors], so If I am doing this for the second time, and trying to upload a single file, what the PHP processign code receives is 2 files: the one I previously uploaded and the one I want to upload now. If i repeat this a third time, php receives now 3 files instead of 1.

                        Because of the error message I'm getting I assume things can be fixed if I can terminate the previously opened file browsing session. But HOW?
                        I googled, and search in Adobe for the error MethodInfo-222() but didn't find any hits.

                        I do appreciate a lot any insights into this issue.

                        The code that is giving me these issues is: