www.webdeveloper.com
Results 1 to 2 of 2

Thread: Send binary data with IE 7's XmlHttpRequest

  1. #1
    Join Date
    Sep 2008
    Posts
    1

    Question Send binary data with IE 7's XmlHttpRequest

    Ok, I'm reading the content of a local binary file with the method mentioned here: http://nagoon97.wordpress.com/2008/0...es-using-ajax/

    Then I'm getting the data as a string where each character represents the binary value. I have successfully sent that string with Mozilla's XmlHttpRequest's sendAsBinary method, but IE 7's version doesn't have that method...

    Using the send method almost works, the only problem is that binary content can be represented as the asciicode 0. This means that the string read by sent is cut off as soon as it is encountered. That means that the part before the first NULL character (asciicode = 0) is successfully sent to the server.

    The solution I have made right now is to increment each character's asciicode on the client side by one and decrement them on the server before converting the character to the binary representation. The downside with this is that the size of the data sent between the client and server gets larger than the original filesize. Ex: 8kb file grows to ~12kb.

    So my question is if anyone have a better solution?

  2. #2
    Join Date
    Feb 2011
    Posts
    1

    base64 encoding

    what about base64 encoding?
    it shouldn't add up too much to the image size

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles