0

I need to encrypt a file before posting it. In WebKit, I know that with FileWriter, I could just rewrite the file then post it, but my solution needs to be crossbrowser compatible.

I could also take all my blobs and pass them to a flash uploader, but I would create another problem.

Is there a method in javascript to post an ArrayBuffer or a byte array as a file?

Right now, I think about Ajax, but could it handle 200MB+ files?

[Edit]

Interesting: How to convert dataURL to file object in javascript?

It seems possible to post Blob via Ajax.

Community
  • 1
  • 1
Léon Pelletier
  • 2,701
  • 2
  • 40
  • 67
  • http://stackoverflow.com/questions/246801/how-can-you-encode-to-base64-using-javascript#246813 Not sure if this is what you are after – Gerard Sexton Dec 18 '12 at 03:55

1 Answers1

0

Just checked again the above link, and following the caniuse.com table, BlobBuilder is compatible with all current browsers, so it is possible to

  1. Take a bytearray or any other data
  2. Convert it to base64
  3. Convert it to blob
  4. Send it as a normal file with Ajax/xhr/FormData using your favorite method
Léon Pelletier
  • 2,701
  • 2
  • 40
  • 67