Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
UPLOAD_ERR_FORM_SIZE: 2,
UPLOAD_ERR_PARTIAL: 3,
UPLOAD_ERR_NO_FILE: 4,
UPLOAD_ERR_NO_TMP_DIR: 6,
UPLOAD_ERR_CANT_WRITE: 7,
UPLOAD_ERR_EXTENSION: 8,
// BIRD3 specific
UPLOAD_IMG_CANT_RESIZE: -1,
UPLOAD_IMG_UNSUPPORTED: -2,
UPLOAD_FILETYPE_MISMATCH: -3,
UPLOAD_ERROR_SAVE: -4
};
// Refferences to buttons
var $button = document.getElementById("upload_trigger");
var $ladda = ladda.create($button);
var $input = document.getElementById("upload_holder");
var $fd = document.getElementById("filedrop");
// Zoooooooone o.o
var zone = window.zone = new filedrop.FileDrop($fd, {
iframe: {
url: location.href,
fileParam: "image"
},
//input: $input,
multiple: false
});
// Set up an additional handler for the button, cause the button is a derp.
var $fdInput = zone.findInputRecursive(zone.zone);
$button.click(function(e){
UPLOAD_ERR_FORM_SIZE: 2,
UPLOAD_ERR_PARTIAL: 3,
UPLOAD_ERR_NO_FILE: 4,
UPLOAD_ERR_NO_TMP_DIR: 6,
UPLOAD_ERR_CANT_WRITE: 7,
UPLOAD_ERR_EXTENSION: 8,
// BIRD3 specific
UPLOAD_IMG_CANT_RESIZE: -1,
UPLOAD_IMG_UNSUPPORTED: -2,
UPLOAD_FILETYPE_MISMATCH: -3,
UPLOAD_ERROR_SAVE: -4
};
// Refferences to buttons
var $button = document.getElementById("upload_trigger");
var $ladda = ladda.create($button);
var $input = document.getElementById("upload_holder");
var $fd = document.getElementById("filedrop");
// Zoooooooone o.o
var zone = window.zone = new filedrop.FileDrop($fd, {
iframe: {
url: location.href,
fileParam: "image"
},
//input: $input,
multiple: false
});
// Set up an additional handler for the button, cause the button is a derp.
var $fdInput = zone.findInputRecursive(zone.zone);
$button.click(function(e){