-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add readAsArrayBuffer and drop support for readAsBinaryString #45
Comments
Just a quick followup related to this I figured I would note. I tried readAsText and the data returned was "nil" when using the flash fallback (IE9). But when using readAsDataURL I got what I needed on all browsers. Wasn't sure if the nil was due to the fact that I was reading binary data. |
Same issue here, we would like to see readAsArrayBuffer implemented if possible. Are there any workarounds to apply in the meantime? |
Adding support for readAsArrayBuffer will require dramatic alterations here and there. I will definitely come to this one sooner or later, but not for current release. |
This will do for now, thanks! :) |
no offence guys but i tried readAsArrayBuffer on IE 10.0.9200.16736 and isn't working |
readAsArrayBuffer is not implemented yet, the temp solution was to emulate readAsBinaryString where it is not present. |
Any progress on this? Is there an expected release date for this functionality? |
Any updates on this? |
@andy250 can you describe in more detail how do you plan to use it?
|
@jayarjo I planned to use this method to read file chunk into a byte array (raw bytes from disk). Then feed this byte array to spark-md5 to calculate its md5 hash. I got it working already using browser's native FileReader and I suppose there is some workaround to achieve this in other runtimes. I already thought about converting the string I got from BTW: why there is a problem to read raw file bytes e.g. in flash? |
Flash doesn't allow direct access to file source until you preload the whole file in memory, which is not desirable operation in most cases. And then there's a need to pipe those bytes to and from the runtime, which basically kills all the benefit of using ArrayBuffer in first place. You can always get hold of the native browser file object by doing |
@jayarjo Thanks. But even if I use file.getSource, then (when runtime is flash) this must be the whole file, right? So I cannot really chunk it. And how does it look in silverlight? Same restrictions and no point in using the ArrayBuffer? |
It appears that readAsBinaryString is no longer supported by the HTML5 spec. Although implemented in some browsers (Chrome, Firefox) it will likely be removed in future releases. In addition IE10 was released late enough that they never needed to support it (but they do support readAsArrayBuffer and readAsText and readAsDataURL).
The end result of the current situation is that:
The text was updated successfully, but these errors were encountered: