commit ae930a410c18cead84cf2fe9b147e027d88ae953
parent 5399605ecb1f06940be01cee2ab50d7655d1849b
Author: Alexander Burger <abu@software-lab.de>
Date: Tue, 1 Nov 2011 08:54:30 +0100
File API getAsBinary() is deprecated
Diffstat:
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/lib/form.js b/lib/form.js
@@ -1,4 +1,4 @@
-/* 06may11abu
+/* 29oct11abu
* (c) Software Lab. Alexander Burger
*/
@@ -257,10 +257,14 @@ function post(form, file) {
if (!file)
FormReq.send(data);
else {
- FormReq.setRequestHeader("X-Pil", "*ContLen=");
- FormReq.sendAsBinary(data + "&*Drop=" +
- encodeURIComponent(file.name) + "=" +
- file.size + "\n" + file.getAsBinary() );
+ var rd = new FileReader();
+ rd.readAsBinaryString(file);
+ rd.onload = function() {
+ FormReq.setRequestHeader("X-Pil", "*ContLen=");
+ FormReq.sendAsBinary(data + "&*Drop=" +
+ encodeURIComponent(file.name) + "=" +
+ file.size + "\n" + rd.result );
+ }
}
}
catch (e) {