From b1c17a50872aef6331883df221662cc361d15a7b Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Thu, 15 Feb 2018 20:28:53 +0100 Subject: Add support for pasting files. --- fbin/templates/upload.html | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'fbin') diff --git a/fbin/templates/upload.html b/fbin/templates/upload.html index 9fe1571..00f4de8 100644 --- a/fbin/templates/upload.html +++ b/fbin/templates/upload.html @@ -56,6 +56,12 @@ $(document).ready(function() { $(':file')[0].files = event.originalEvent.dataTransfer.files; } }); + $(document).on('paste', function(event) { + var files = (event.clipboardData || event.originalEvent.clipboardData).files; + if (files.length === 1) { + $(':file')[0].files = files; + } + }); }); {% endblock %} -- cgit v1.2.3