4 Replies Latest reply on Nov 3, 2007 3:53 PM by Simon Bailey

    Flex Uploading Issue

    Simon Bailey Level 1

      I am having great trouble with Flex and ColdFusion when it comes to
      uploading. I can upload fine to a server with no authentication set
      up but as soon as I start to upload using FileReference and
      UrlRequest to a server with authentication from cflogin problems
      occur. Basically it fails silently, it displays progress in the
      upload and that the upload was successful but my files is not there.
      I have check all my scripts and location for the file upload and it
      just aint happening. I have tested a simple cfm upload form and hit
      that fine, uploaded and can write to files also on the remote server
      so I know thats set up fine.

      So after much googling I have found that when using FileReference for
      uploading the upload will use a new browser session to upload the
      files and therefore remove all session variables!!! Arrrrggh! So my
      work around has involved grabbing the session.URLToken, sending that
      into my Flex app and then when I call the upload cfm script pass the
      session.URLToken variables in the url string like so:

      request = new URLRequest();
      chosenFile = fr.name;
      request.url = UPLOAD_URL+"?"+sessionVars;

      Problem is it still doesnt work?
      (a) I dont know if that is enough to satisfy cflogin criteria i.e. do
      I need to set anything in the upload.cfm page to say that these are
      the session variables.
      (b) another weird thing is that if it is starting a new browser
      session why am I not presented with my login panel as requested by my

      Any one else suffered here or could make a suggestion please :)


      P.S. I understand this is not an issue in IE only Firefox (and Safari I have discovered)!

        • 1. Flex Uploading Issue

          Just a question... are you uploading from a MAC operating system? The clearing of the session has also been a problem to me but it is possible to post the session id along with other post parameters.

          I am facing the problem called ioError 2038 every time I'm trying to upload from a MAC platform. No browser work here. Actually the uploading server side php script is never reached because of the error 2038. I do not know if I'm missing some important header information or mime types, beats me??

          I forgot to refer to the case I have opened in here:

          http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=585&threadid =1311564&enterthread=y
          • 2. Flex Uploading Issue
            Simon Bailey Level 1
            This is most peculiar cos I am definitely not hitting the server side script (which I thought was due to session clearing) but may not be then cos I get no error like you state and also my login window doesn't rear its ugly head. But I DO know for certain, the server script is not being hit, cos I run a simple write action to append a log file and that is not even running???

            And yeh uploading from a mac os x system. However, it fails in FireFox on the PC also.


            post 91

            Check this:


            Through Flash's FileReference and FileReferenceList classes, you can create a powerful file uploader that allows the user to upload multiple files with a single form element. But beware: unless the user happens to be using IE, the upload will use a new browser session to upload the files. This means that if you require that a user be authenticated before uploading something (and you better be), the upload won't work - the request will be forwarded to the login form, or to wherever your system forwards unauthorized requests. This is a maddening bug to track down, and there is nothing you can do to make Flash use the right session. The work around is to send the session cookie in the url and, on the server side, use that to override the new (and wrong) session cookie sent by Flash
            • 3. Re: Flex Uploading Issue
              musicplayer_dk Level 1
              Hi again

              But you do use MAC when testing it? I'm having no trouble whatsoever on a windows pc platform.. uploading works in all tested browser here... but I would really appreciate if someone holds the key to solve this strange problem :-)
              • 4. Re: Flex Uploading Issue
                Simon Bailey Level 1
                sorry man I was editing my post to state the mac answer and you posted in the meantime :)