You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have abootstrap 3 / jquery 1.9.1 (with migrate 1.1.1) page with an <article> container. I want to be able to drop anywhere on that article in order to upload.
Chrome doesn't register anything on the console when one or more files are dropped, and nothing is transferred on the network. The various highlights I've put on docOver and stuff work, so it's starting to bind things.
No errors or warnings in console. I dropped a console.log(builder) before xhr.sendAsBinary(builder) - doesn't even hit the code.
var $container = $("article");
$container.filedrop({
fallback_id: 'manual_upload',
url: '/engine/listUpload.asp',
paramname: 'userfile',
withCredentials: false,
data: { "stop": true },
error: function(err, file) {
switch(err) {
case 'BrowserNotSupported':
alert('browser does not support HTML5 drag and drop');
break;
case 'TooManyFiles':
alert('too many files');
break;
case 'FileTooLarge':
alert("one or more files were too big");
break;
case 'FileTypeNotAllowed':
alert("You dropped un-uploadable file types");
break;
case 'FileExtensionNotAllowed':
alert("Files with this extension are not allowed");
break;
default:
alert("some error maybe " + err + "\n" + file);
break;
}
},
allowedfiletypes: ['image/jpeg','image/png','image/gif'], // filetypes allowed by Content-Type. Empty array means no restrictions
allowedfileextensions: ['.jpg','.jpeg','.png','.gif'], // file extensions allowed. Empty array means no restrictions
maxfiles: 10,
maxfilesize: 20,
queuefiles: 2,
docOver: function() {
$container.css("background-color", "rgba(255,128,0,.5)");
},
docLeave: function() {
$container.css("background-color", "");
},
drop: function() {
$container.css("background-color", "");
},
uploadStarted: function(i, file, len){
console.log("uploadStarted", i,file,len);
},
uploadFinished: function(i, file, response, time) {
console.log("uploadFinished", i, file, response, time);
},
afterAll: function() {
console.log("seems to think everything is done now");
}
});
I tried modifying the plugin to work out why sendasbinary wasn't working. I threw in some console junk.
try {
console.log("-33333333333333333333333333333-");
if (XMLHttpRequest.prototype.sendAsBinary) {
console.log("-------------!!!!!!!!!!!!------------");
return;
}
XMLHttpRequest.prototype.sendAsBinary = function(datastr) {
console.log("-----?????????--------------??????????------");
function byteValue(x) {
return x.charCodeAt(0) & 0xff;
}
var ords = Array.prototype.map.call(datastr, byteValue);
var ui8a = new Uint8Array(ords);
// Not pretty: Chrome 22 deprecated sending ArrayBuffer, moving instead
// to sending ArrayBufferView. Sadly, no proper way to detect this
// functionality has been discovered. Happily, Chrome 22 also introduced
// the base ArrayBufferView class, not present in Chrome 21.
if ('ArrayBufferView' in window)
this.send(ui8a);
else
this.send(ui8a.buffer);
};
} catch (e) {
console.log("XXxXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", e);
}
My console reads -33333333333333333333333333333- and stops there. Doesn't even log inside an exception, or the function declaration. So it seems testing forXMLHttpRequest.prototype.sendAsBinary kills the object.
The text was updated successfully, but these errors were encountered:
I have abootstrap 3 / jquery 1.9.1 (with migrate 1.1.1) page with an
<article>
container. I want to be able to drop anywhere on that article in order to upload.Chrome doesn't register anything on the console when one or more files are dropped, and nothing is transferred on the network. The various highlights I've put on docOver and stuff work, so it's starting to bind things.
No errors or warnings in console. I dropped a console.log(builder) before xhr.sendAsBinary(builder) - doesn't even hit the code.
I tried modifying the plugin to work out why sendasbinary wasn't working. I threw in some console junk.
My console reads
-33333333333333333333333333333-
and stops there. Doesn't even log inside an exception, or the function declaration. So it seems testing forXMLHttpRequest.prototype.sendAsBinary
kills the object.The text was updated successfully, but these errors were encountered: