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 8155717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:44:48+00:00 2026-06-06T16:44:48+00:00

I am following Html5rocks tutorial http://www.html5rocks.com/en/tutorials/file/dndfiles/ and I am trying to use readAsArrayBuffer instead

  • 0

I am following Html5rocks tutorial

http://www.html5rocks.com/en/tutorials/file/dndfiles/

and I am trying to use readAsArrayBuffer instead of readAsBinaryString in slicing a file example (because I want to read gif header to find file resolution). But I am stuck because evt.target.result (while using readAsBinaryString it is a string)

any ideas?

EDIT : Code

reader.onloadend = function(evt) 

{

  if (evt.target.readyState == FileReader.DONE) { // DONE == 2
    document.getElementById('byte_content').textContent = evt.target.result;
    console.log(evt.target.result.byteLenght)
    document.getElementById('byte_range').textContent = 
        ['Read bytes: ', start + 1, ' - ', stop + 1,
         ' of ', file.size, ' byte file'].join('');
  }
};

if (file.webkitSlice) {
  var blob = file.webkitSlice(start, stop + 1);
} else if (file.mozSlice) {
  var blob = file.mozSlice(start, stop + 1);
}
reader.readAsArrayBuffer(blob);
}

so in Firefox 13 I get on screen : [object ArrayBuffer]

and on console log : undefined

while in Chromium 18 I get on console : Uncaught TypeError: Cannot read property ‘byteLenght’ of null

  • 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-06-06T16:44:50+00:00Added an answer on June 6, 2026 at 4:44 pm

    There is a typing mistake in:

    console.log(evt.target.result.byteLenght)
    

    byteLenght should be byteLength

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

Sidebar

Related Questions

I'm following the tuitions on XMLHttpRequest 2 from : https://developer.mozilla.org/en/DOM/XMLHttpRequest/Sending_and_Receiving_Binary_Data and http://www.html5rocks.com/en/tutorials/file/xhr2/#toc-send-arraybuffer They're great
Following chunk html code works as expected: <iframe src=http://www.amazon.com/></iframe> But when trying embed inner
Following this documentation ( https://docs.djangoproject.com/en/dev/topics/http/views/#customizing-error-views ), I am trying to create a custom error
Following the instructions here: http://www.padrinorb.com/guides/padrino-mailer I have the delivery method added on the app.rb
Following Hanselman's post about the new ASP.NET Universal Providers: http://www.hanselman.com/blog/IntroducingSystemWebProvidersASPNETUniversalProvidersForSessionMembershipRolesAndUserProfileOnSQLCompactAndSQLAzure.aspx How would you configue
Following this JavaFX 2.0 tutorial I created a css file in eclipse that includes
Following this tutorial: http://viralpatel.net/blogs/2010/07/spring-3-mvc-tiles-plugin-tutorial-example-eclipse.html Tiles configuration ( tiles.xml ) : <?xml version=1.0 encoding=UTF-8 ?>
Following this: http://developer.android.com/training/basics/firstapp/starting-activity.html I am confused when editing the Android Manifest.xml file. It says
Following is the Play 2 app, https://github.com/playframework/Play20/tree/master/samples/java/forms Which portrays Dynamic form binding where form
Following on from an earlier question I'm trying to get multiple (widgets or in

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.