Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3213136
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:54:38+00:00 2026-05-17T14:54:38+00:00

I use the following to upload a file to Flex: private var filer:FileReference; protected

  • 0

I use the following to upload a file to Flex:

        private var filer:FileReference;
        protected function button1_clickHandler(event:MouseEvent):void
        {
            var fd:String = "Files (*)"; 
            var fe:String = "*"; 
            var ff:FileFilter = new FileFilter(fd, fe);
            filer = new FileReference();
            filer.addEventListener(Event.SELECT, onFileSelect);
            filer.browse(new Array(ff));
            filer.addEventListener(Event.COMPLETE, 
                function (e:Event):void {
                    e.currentTarget.data.toString();
                }
            );
        }
        private function onFileSelect(e:Event):void {
            filer.load(); 
        }

And my file looks like this:
alt text

Here is the original file: http://sesija.com/up/1.txt

I need to read the uploaded file and parse it. The problem is that in my e.currentTarget.data.toString(); I get only ‘1‘ and not the rest of the String.

Any idea on how to successfully read this entire txt file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T14:54:38+00:00Added an answer on May 17, 2026 at 2:54 pm

    The data property is a ByteArray. Instead of using the toString method (which apparently treats NULL byte as end of string), use specific read methods of the ByteArray class like readByte, readInt etc.

    var array:Array = [];
    var ba:ByteArray = e.currentTarget.data as ByteArray;
    while(ba.bytesAvailable != 0){
        array.push(ba.readByte());
    }
    trace(array.join(", "));
    

    You might want to read Working with byte arrays

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the following function to rename thumbnails. For example, if I upload a
I wish to use the following regex for validating a file-upload: /^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w ]*))+\.(ext)$/ But
I use following code to resize the image after i upload it. function re-sizes
I receive the following error when I use weblcient to upload a file System.Net.WebException:
Can I use the following jQuery code to perform file upload using POST method
I tried to use the file upload using Apache Commons but the following exception
I currently use the following code to upload one file to a remote server:
I want to use progress bar to show file upload progress. I'm currently using
I'm using jQuery file upload plugin . I don't use the UI part, only
I am asking the user to upload a file, through the following form making

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.