4 Replies Latest reply on Oct 22, 2007 7:49 AM by Alberto_Mz

    machine user name

    Alberto_Mz
      Hi,

      I wonder if is possible to know the machine user name where the flex application is running for example in VB .Net exists this : My.User.Name

      Also i would like to know if there are packages which allows me to copy files, create folder, delete folders, etc.

      Thanks.

      Juan Martinez
        • 1. Re: machine user name
          atta707 Level 2
          I don't think flash player allow such info as the name of current user.

          as for creating/copying files, if you're referring to client machines this won't be possible. Of course, you can upload/download files from server. Search for FileReference and upload/download keywords in Flex Builder help.

          ATTA
          • 2. Re: machine user name
            Alberto_Mz Level 1
            I have been trying upload files using FileReference with different scripts (.cfm , .php) but i alway get an error:

            Error #2044: IOErrorEvent : text=Error #2038: I/O Error File

            something like that

            Do i need to configure something besides the url??

            Thanks
            Juan Martinez
            • 3. Re: machine user name
              atta707 Level 2
              In the Flex Builder help, search for "upload download file" keywords.

              here is an example:

              var fileRef:FileReference = new FileReference();
              fileRef.addEventListener(Event.SELECT, selectHandler);
              fileRef.addEventListener(Event.COMPLETE, completeHandler);
              try
              {
              var success:Boolean = fileRef.browse();
              }
              catch (error:Error)
              {
              trace("Unable to browse for files.");
              }
              function selectHandler(event:Event):void
              {
              var request:URLRequest = new URLRequest(" http://www.[yourdomain
              try
              {
              fileRef.upload(request);
              }
              catch (error:Error)
              {
              trace("Unable to upload file.");
              }
              }
              function completeHandler(event:Event):void
              {
              trace("uploaded");
              }



              ATTA
              • 4. Re: machine user name
                Alberto_Mz Level 1
                Hi,

                I've already tried different example like yours but i think i have a problem with permissions, i've read something about trusted sandboxes and something about reclassify the SWF file as local-with-networking or trusted, but i don't know to do that, i always get this error message:

                Error #2044: IOErrorEvent no controlado: text=Error #2038: Error de E/S de archivo.
                at com.example.programmingas3.fileio::FileUpload/init()[C:\Documents and Settings\martinezjua1\My Documents\Flex Builder 2\FileIO\com\example\programmingas3\fileio\FileUpload.as:31]
                at FileIO/__fileUpload_creationComplete()[C:\Documents and Settings\martinezjua1\My Documents\Flex Builder 2\FileIO\FileIO.mxml:6]

                it's in spanish but it says something like: IOErrorEvent not handled and Error #2038: I/O error file