;(function ($) {
$(".input").bind("paste", function(evt) {
var item = (evt.clipboardData || evt.originalEvent.clipboardData).items[0] || null;
if (item && item.kind === "file" && item.type.indexOf("image") !== -1) {
var file = item.getAsFile(),
data = new FormData();
data.append('file', file);
$.ajax({
url: "/upload",
type: "POST",
data: data,
contentType: false,
processData: false,
success: function (r) {
// ...
}
})
}
})
})(jQuery)